LPS-49456 Classloader deadlock in ModuleFrameworkClassLoader

Hey Miguel,

I noticed that Master sometimes fails to start, which happened very scarcely. Finally I faced this behaviour today again and debugged a bit.

It was a classloader deadlock between ModuleFrameworkClassLoader and Tomcat's WebappClassLoader.

The main problem was that ClassLoaders before Java7 locked on the whole ClassLoader, while as of Java7, it's possible to lock for the (ClassLoader + The name of the class being loaded).

Thanks for reviewing!

Please let me know if you have any conerns.

Cheers,
László.