Make sure program exits even if sockets hang.