tcp: use getaddrinfo() for hostname resolution

gethostbyname_r() is GNU extension not supported on some platforms.
This commit replaces it with POSIX standard getaddrinfo() call.
SAT>IP: allow to specify the local bind IP address
IPTV: Fix the remaining memory leaks