add cleanCloseHandler: return from http handler immediately if remote hangs up
This PR adds a middleware which ensures that if an API caller hangs up the API request early, before the underlying handler finishes, the connection will be fully closed. Previously, the connection would stay half-open (CLOSE_WAIT
) until the underlying handler finished, which could cause a buildup of useless open sockets.