Set close-on-exec flag for UDP socket.