fixed potential issue with ThreadLocal holding a reference beyond necessity. Raised a warning in Tomcat undeploying a war file.