Fix various issues highlighted when running the Autobahn test suite on Linux.
- Don't register the socket for a read when a write event completes (may lead to thread starvation)
- Use a dedicated lock rather than the ServletOutputStream to protect the writing of a WebSocket message
- Add a lock to protect the write buffer from concurrent calls to writeInternal()
- Add a lock to ensure a consistent view of buffer and fireListenerLock

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