Tighten up the close code to reduce the chances of a socket being closed more than once. This also provides some plumbing required by the next commit to ensure that sockets are not registered for read or write once they have been closed.
Tighten up the close code to reduce the chances of a socket being closed
more than once.
This also provides some plumbing required by the next commit to ensure
that sockets are not registered for read or write once they have been
closed.

git-svn-id: 79cef5a5a257cc9dbe40a45ac190115b4780e2d0@1665985 13f79535-47bb-0310-9956-ffa450edef68

apache/tomcat,apache/tomcat,apache/tomcat,Nickname0806/Test_Q4,Nickname0806/Test_Q4,apache/tomcat,Nickname0806/Test_Q4,Nickname0806/Test_Q4,apache/tomcat