Make an earier copy of the rules to close up the window for concurrent modification to break things.

we've recently picked switched to SCSS in openstack Horizon and we are seeing some intermittent scss compile failures:  https://bugs.launchpad.net/horizon/+bug/1345955.  We think it's related to multiple threads attempting to compile the same scss files.

We are exploring ways to avoid the multithreading altogether, but it seems to me much safer if the compilation just worked.  It seems that the compiler "apply_extends" method breaks if multiple threads run through it; but the fix seems as easy as just making a copy of self.rules at the start of the method, process the copy and set it back at the end.

Sharing my prototype code that fixes the problem in my dev environment.