http: implement #connected? and #close pair