Flush the command queues of unsubscribed conenctions before closing sockets