Optimize ResolveDataChangeEventsTask object allocation
ResolveDataChangeEventsTask queried before/afterData methods multiple
times. The default implementation in yangtools instantiates an object on
each call, which leads to sub-optimal performance. Cache the returned
object and use it locally, which actually makes the code more readable.
As a further change, perform the same caching with modification type, as
that may end up being computed on access.
Change-Id: I43aa4824c1a5788060035cd419400d86b0116de7
Signed-off-by: Robert Varga <rovarga@cisco.com>