Check before sending to a closed socket