Improve condition wait fast paths using atomic compare-and-swaps.