cmd/go/internal/modfetch: fix concurrent read/write race in modfetch
cmd/go/internal/modfetch: fix concurrent read/write race in modfetch

On Windows systems, the failure rate for cmd/go's TestScript/mod_concurrent
is somewhere around 3-10% without this change. With the change, I have yet
to see a failure.

Fixes #31744.

Change-Id: Ib321ebb9556dd8438086cf329dfa083a9e051732
Reviewed-on: https://go-review.googlesource.com/c/go/+/174439
Run-TryBot: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

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