master: Checked whether socket is connected or connecting before closing the transport.