The WaitForState method can't read the result values in a timeout because they are still owned by the running goroutine. Keep all values scoped inside the goroutine, and save them into an atomic.Value to be returned. Fixes race introduced in #8510