cmd/dist: produce intermedate .a files in a temporary location
cmd/dist: produce intermedate .a files in a temporary location

Before this change, the .a files for the intermediate go toolchains
were produced in the same location as the install target. This change
has them produced in a temporary location instead. This change,
combined with go install not producing .a files for most stdlib
packages by default results in a build of the distribution only
producing .a's for the five packages in std that require cgo. (Before
this change, the .a's for the final build were not being produced, but
stale ones from the intermediate builds were left behind.)

For #47257

Change-Id: I91b826cd1ce9aad9c492fb865e36d34dc8bb188e
Reviewed-on: https://go-review.googlesource.com/c/go/+/436135
TryBot-Result: Gopher Robot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Run-TryBot: Michael Matloob <4562438b12c14e81a47550acde616ff328a909f8@golang.org>
Reviewed-by: Bryan Mills <1c8aad60184261ccede67f5c63a0d2a3bf3c9ff4@google.com>
Reviewed-by: Michael Matloob <4562438b12c14e81a47550acde616ff328a909f8@golang.org>

golang/go,golang/go,golang/go,golang/go,golang/go,golang/go,golang/go,golang/go