Replace use of the hilariously broken DNSServiceQueryRecord with
calls to res_search and the parsing routines in libresolv.

This means that we're using a background thread instead of a socket
on a run loop.  It also changes the codes that we pass in.

Additionally, return a DNSQueryNoSuchDomain error if we get
HOST_NOT_FOUND from libresolv.