make tcpserver test independent from the local DNS

previously, check_tcpserver could have failed for
a testing host DNS (mis)configuration.

Now, getaddrinfo() is stubbed, so the tests are independent
and encapsulated.