Check for closed sockets earlier and reduce code duplication.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1534540 13f79535-47bb-0310-9956-ffa450edef68
Remove socket from list of connections as soon as we know it is going to be closed.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1534543 13f79535-47bb-0310-9956-ffa450edef68
Add wrapper information to error message

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