Resolve hostnames over SOCKS5

Resolve hostnames via the SOCKS5 proxy if one is being used. This
prevents anonymity leakage when using Tor.