Update http.js

change Event "close " to "end"
if there is an error , use  destroy()