Purge all pending messages when socket closes