DMRECON: refactor ImgPyramidCache access

Now, ImgPyramidCache (instead of SingleView) creates the pyramid when
it's not available. Also use static methods to access the cache instead
of a global variable and protect it with a single mutex only.
DMRECON: implement cache cleanup

Use RefPtr for image pyramids, implement a cleanup function for the
image pyramid cache.