correctly throw connection errors if the server drops while sending the HTTP response body (#2815)