[FIX JENKINS-4409] Release plugins and class loaders when JVM shuts down.
Touching up on the fix by ikedam