Timeout if UDP port isn't reachable

Add timeout to the UDP socket. Without it client would block infinitely
if creating a control connection succeeds, but UDP packets are dropped
by firewall.
Add ifdef to the SO_RCVTIMEO code

Not all platforms have a SO_RCVTIMEO socket option.
Merge pull request #222 from hasso/timeout-udp

Timeout if UDP port isn't reachable.

This handles the case that a control connection succeeds but UDP packets are blocked by a firewall.