Change connection create function

Don't need anymore the connection domain, take it directly form the
sockaddr passed to the function.

Also, set the refcount to 1 on creation.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Implement the connect(2) torsocks call. Not final but working

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Implement the gethostbyname(3) torsocks call

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: SOCKS5 connect reply was not receiving the correct len

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Implement the getaddrinfo(3) torsocks call

The tor resolve API does not support IPv6 yet at this commit so
getaddrinfo basically only supports IPv4 for now.

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