Protect against crashes when trying to send to non-connected sockets.