Implement new approach to locking

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1444768 13f79535-47bb-0310-9956-ffa450edef68
Add Writer test

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1444769 13f79535-47bb-0310-9956-ffa450edef68