Split parse_url to allow for external error handling
auto merge of #2341 : Manishearth/servo/error-parse, r=jdm

Sometimes it's useful to bubble out the error from the URL parsing so the caller can deal with the result as per its needs.

[The XHR `open()`](http://xhr.spec.whatwg.org/#the-open()-method), for example, is one place where the bubbling out of an error is required.

Blocks #2282