Fixed a few obscure bugs with cookies in http_request.