tests: Add torture library from socket_wrapper

Pretty much a blatant copy of the torture library from socket_wrapper,
just s/echo_srv/dns_srv/
tests: Add generating resolv.conf to torture
tests: Add a unit test for res_query