Split the request-specific code from HttpConnection.

Also added a number of CHECKs and comments to clarify the logic.
Allow setting the timeout on HttpConnection.
HttpRequest::Done can receive a null request in case of timeout.
Add support for cancellation of HTTP requests.