Making cmdReady wait and clear more atomic, but more importantly, processing the queue until it is empty in case one cmdReady.set() cascades over another.