Handle http(s) request errors

Add a handler for the 'error' event on the request object.
It sets a `error` field on the parser object and calls `after_parse`
with `success = false`