Avoid trying to read a packet from the socket, when socket is closed (fixes #38)