Properly queue Close messages when in disconnected state, close #1736