Add localhost resolve utils function

Using a hostname, address family (v4/v6) and a buffer, this function
tries to match the hostname to the localhost names list local to
torsocks. If found, the given buffer is populated with the corresponding
IP address.

This is the first step to remove gethostent() in the code. It's
important for torsocks to be able to resolve localhost but it should NOT
try to resolve DNS with a local file (ex: /etc/hosts). One use cases is
for SSH to be able to bind to localhost for a SOCKS proxy for instance
using torsocks hence needing to resolve local name.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Fix: remove gethostent() usage

Torsocks should not allow any local file resolution for external
hostname (not localhost stuff). Furthermore, gethostent() could do LDAP
listing thus clearly UNSAFE here.

This patch removes the use of gethostent() and replace it with the new
utils function that only resolves the hostname against localhost
hardcoded value.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Test: add unit test for sockaddr_is_localhost

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