
Add pthread support to send the UDP queries.

Add a fail path, when waiting for recvdata() failures.
