Added extra check just in case modem channel gets externally closed while listen() is running.