Fix pause/resume tests so that main thread uses channels instead of sleeping to ensure that tasks under test have started.