Non-blocking DNS lookup.

http://jenkins.tribler.org/job/Test_community_walking_NAT/176/console

The Jenkins job above blocks a very long time when DNS lookup fails.  This code ensures that the Dispersy thread doesn't block for longer than a given timeout, allowing the Jenkins job to quit more timely.