cmd/dist: pass cgotest linkmode via GOFLAGS
cmd/dist: pass cgotest linkmode via GOFLAGS

cgotest attempts to exercise various linkmodes, however with recent refactoring
TestCrossPackageTests is no longer running tests with these linkmodes. Specifying
the linkmode via GOFLAGS restores previous behaviour.

Note that the -ldflags="-linkmode=external -s" case cannot be passed through
as GOFLAGS does not permit spaces in values and -ldflags can only be specified
once.

Fixes #31083.

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

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