Fix: bad reference in getaddrinfo() using inet_pton

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: socks5 connect use connection domain and correct len

The connection we are trying to do tells us if we need to connect to Tor
in ipv6 or ipv4 since the socket that we send back needs to be connected
with the right socket family.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: use libc close() when resolving through Tor

Signed-off-by: David Goulet <dgoulet@ev0ke.net>