The essence of fix is exactly same as for similar problems
in java.util.LogManager and javax.imageio.stream (CRs 6799583
A thread instance used as a shutdown hook keeps a reference
to an applet classloader and prevents applet's resources
Suggested solution is to clear the shutdown hook's context
classloader. Except this, a main thread group is used for
creation of the shutdown hook, in order to prevent potential
failure of the hook's execution (see CR 6222850).
There is yet another long leaving thread which may lock
the applet classloader: it is sun.java2d.Disposer.
Their context classloader is also cleared by the fix.