Fix layer styles dialog breaking the global Fg->Bg gradient
It looks like we don't create copies of the required resources when putting them in the local storage. Whether we should do that or not is a rather disputable topic (because it can cause efficiency problems). So right now we should just be careful when baking the gradients, and make copies explicitly.
The patch is also partially related to the problem mentioned in the bug 445390 (though it doesn't fix it):