Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55633 for NIO.
The Comet code that ensured that multiple threads didn't process the same socket when the selector indicated that a socket was ready for read and write pre-dated r1001698 where syncs where added to the SocketProcessor to achieve the same aim for Servlet 3.0 asyncs processing.
The Comet code was re-used to handle upgraded connections.
The upgrade code did not handle the case where a socket was registered for read and write but only a write event occurred. In this case the read registration was lost. This is the root cause of the lack of responsiveness observed in bug 55633.
With the changes in r1001698, a simpler solution can be used for both
Comet and HTTP upgrade. The new approach unregisters the socket operations the selector has reported ready for and then triggers a read and/or write as appropriate. For Comet the syncs will ensure that read and write aren't processed in parallel. For HTTP upgrade such parallel processing is permitted.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk@1530182 13f79535-47bb-0310-9956-ffa450edef68
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55633 for APR.
If the socket was registered for read and write and only one occurred, the registration for the other event was lost. Ensure that the socket is re-registered with the Poller when necessary.

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