HTTPSocket was not getting closed on HTTP errors, fixed