[Test] Fixes flaky racing in lib_2/isolate/spawn_uri_test.
[Test] Fixes flaky racing in lib_2/isolate/spawn_uri_test.

This is similar to https://dart-review.googlesource.com/c/sdk/+/108410.

Prior to this fix, the test was running at ~3% flaky locally:
  ~> tools/test.py -n dartk-optcounter-linux-release-x64 lib_2/isolate/spawn_uri_test --repeat=100

Change-Id: I7d6422eaf5e56ec8fbe0c287da12b19bf13716db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110913
Commit-Queue: Clement Skau <495593248b6158163719b90dde8357b589c8e5d0@google.com>
Reviewed-by: Martin Kustermann <a35dd5b79fac84b2bb3b026a16b8becc55af5961@google.com>

dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk