This prepares sync.WaitGroup for multithreading. Code size for the cooperative scheduler is nearly unchanged.