url: raise error if CONNECT request to proxy was unsuccessful

The deleted code didn’t work on Python 3. On Python 2 (or Python 3 after
adapting it), the function returned in the error case. The subsequent creation
of SSL socket fails during handshake with a nonsense error.

Instead, the user should get an error of what went wrong.

I don’t see how the deleted code would be useful in the error case. The new
code is also closer of what the standard library is doing nowadays that it has
proxy support (which we don’t use in the moment).

In the test, I use port 0 because all the HGPORTs were already taken. In
practice, there should not be any server listening on port 0.
14 jobs for topic/stable/url-proxy-connect-error in 47 minutes and 38 seconds (queued for 10 seconds)