move close callback from protocol-level to socket-level (so that it would be easier to implement connection pooling in reverse proxy)