http: improvement reset and close handling