Temptative fix for GROOVY-6279

This is a temptative fix for GROOVY-6279. A few comments:

* relies on the fact that `SecurityManager#getClassContext` will not be itself removed
* only suitable if not called too often (measured 100x slower than reflection by @YannisBres)

Please discuss alternatives here.