Correctly set Host header when using a proxy

Fixed a bug in _set_proxy_headers that ignores the port when setting the
'Host' HTTP header while a proxy is used.