testing: fix racey access to t.failed
testing: fix racey access to t.failed

We need to grab the mutex before we can access it.

Fixes #24438

Change-Id: Idd6130036691acec5bc5f8b40d6884f8db1d9d3c
Reviewed-on: https://go-review.googlesource.com/101283
Run-TryBot: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>

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