Check for res_query, then for __res_query in libresolv

Don't know why there's a check for __res_query, maybe because your version of libresolv doesn't have res_query? Mavericks doesn't have it, but does compile with res_query.

I found a similar commit here:
https://github.com/pasis/libcouplet/pull/2

I notice this check was introduced by commit dcccfacb68caa97131c60f67cc42a30ef8195c31

This commit fixes #254