Fix a potential race condition in KisRecalculateGeneratorLayerJob
In some rare cases (when the color space of the image changed),
KisGeneratorLayer::update() may call resetCache(), which demands
exclusive access to the paint device. So just make it run exclusively.
(cherry picked from commit 430ff1b0ec7fc9ce3aceb925c2df19e1f7898a80)