Fix unsound asserts in cancellation test.