Add an assert_may_sleep() check on every context switch.