Avoid accessing a closed TCP connection when finalizing a request/response in the HTTP server.