Avoid race conditions in test for cancel during configuration.