Fixed a race condition in close. The operation may not be dequeued by the second loop and the closing process may block forever in rendez.