http client: fix the error code passed to conn_closed callback