Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48831
Address issues 1 & 2 by using a ReadWriteLock to control access to the writer. This ensures messages won't be written while the writer is null. Note there is no (easy) way to not close the handler.
Address issue 3 by re-enabling the JULI shutdown hook if JULI is being used and Tomcat isn't stopped via a shutdown hook.
Address issue 4 by making ClassLoaderLogManager#useShutdownHook volatile
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@918594
13f79535-47bb-0310-9956-
ffa450edef68