[vm/concurrency] Grab read isolates_lock when iterating over isolates.
[vm/concurrency] Grab read isolates_lock when iterating over isolates.

When iterating over isolates in IsolateGroup::RegisterStaticField we need to grab read isolates_lock
to prevent data races as isolates_ list might be being updated.

TEST=generated_stress_test

Fixes https://github.com/dart-lang/sdk/issues/46071

Change-Id: I46b9826a268d38d07b1aeec9362de3e5945642fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201342
Reviewed-by: Martin Kustermann <a35dd5b79fac84b2bb3b026a16b8becc55af5961@google.com>
Commit-Queue: Alexander Aprelev <dfb74c35a357c2059971a4bf7fe26b6a7c18085d@google.com>

dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk