avoid timing race in async test (#46941)
This is the test from #27164.
The test was checking whether sleep(1) (which is started first) or
sleep(0.05) (which is nominally shorter) returned first. Use an Event
instead so that they are explicitly ordered.
Fixes #46360