[release-branch.go1.9] cmd/go: clean up x.exe properly in TestImportMain
[release-branch.go1.9] cmd/go: clean up x.exe properly in TestImportMain

More generally I'm concerned about these tests using
$GOROOT/src/cmd/go as scratch space, especially
combined wtih tg.parallel() - it's easy to believe some other
test might inadvertently also try to write x.exe about the
same time. This CL only solves the "didn't clean up x.exe"
problem and leaves for another day the "probably shouldn't
write to cmd/go at all" problem.

Fixes #22266.

Change-Id: I651534d70e2d360138e0373fb4a316081872550b
Reviewed-on: https://go-review.googlesource.com/71410
Run-TryBot: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>
Reviewed-on: https://go-review.googlesource.com/71530

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