libc/tests: add getaddrinfo test
A test suite for getaddrinfo(3) written in C. Unlike NetBSD test, this
one will be mostly focused on what the API should return when something
isn't good with your DNS. Test emulates bad DNS servers in resolv.conf
intercepting fopen(2) and emulates downed network intercepting send(2).
Initial version covers three main scenarios: all good, server(s) timed
out, network down. For each scenario we test hostname with trailing dot
and without, since libc resolver uses quite different code paths,
sometimes even yielding with different error codes. All current error
codes in the test are what our libc returns right now, meaning the test
documents what we have, not what there should be.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D49410