Fix res_query() calls; fix MX record handling during auto-d.

(This change goes along with a corresponding change to NachoClientX.)

Fix the calls to the C library function res_query(), which handles DNS
resolution.  The old code was calling the wrong function.  The correct
function is in libresolv.dylib, so the project files had to be changed
to link in that library.

Fix the way that DNS responses are parsed, so an extra period isn't
added to the end of domain names.

Fix an bug in the handling of MX queries in the auto-discovery state
machine.  The old code would fail with an assertion if the MX query
was actually successful.

This change should improve auto-d for Google accounts.  With luck, you
shouldn't have to type in m.google.com.  But the MX query fails
intermittently, causing auto-d to fail.  (Automatic retries will be a
later update.)  And I haven't done an end-to-end test yet, so I won't
gaurantee that it works yet.