fix race condition in the response copier, close the response body when done, update upstream lib