Implement caching of paint devices in layer styles
Creation of a paint device is an expensive operation, so layer styles
should cache them using KisCachedPaintDevice and KisCachedSelection.
The patch also implement a small RAII-concept for fetching a cached
device and returning it back to the store.