runtime: iterate ms via allm linked list to avoid race
runtime: iterate ms via allm linked list to avoid race

It's pointless to reach all ms via allgs, and doing so introduces a
race, since the m member of a g can change underneath it. Instead
iterate directly through the allm linked list.

Updates: #31528
Updates: #34130

Change-Id: I34b88402b44339b0a5b4cd76eafd0ce6e43e2be1
Reviewed-on: https://go-review.googlesource.com/c/go/+/198417
Run-TryBot: Jason A. Donenfeld <e7e312fea4c2c1aad2bb075d739111890e1ce08b@zx2c4.com>
Reviewed-by: Alex Brainman <54ba58c8441b5eff861de6b4e5ee46baf086b142@gmail.com>
Reviewed-by: Austin Clements <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

nawawi/go,CAFxX/go,akutz/go,CAFxX/go,golang/go,akutz/go,CAFxX/go,cloudflare/go,golang/go,akutz/go,cloudflare/go,akutz/go,cloudflare/go,nawawi/go,nawawi/go,akutz/go,nawawi/go,golang/go,cloudflare/go,nawawi/go,cloudflare/go,akutz/go,cloudflare/go,cloudflare/go,CAFxX/go,golang/go,CAFxX/go,nawawi/go,cloudflare/go,CAFxX/go,akutz/go,CAFxX/go,akutz/go,golang/go,golang/go,CAFxX/go,nawawi/go,golang/go,nawawi/go,golang/go