misc/cgo/testcarchive: don't rely on an erroneous install target in tests
misc/cgo/testcarchive: don't rely on an erroneous install target in tests

Non-main packages in module mode should not be installed to
GOPATH/pkg, but due to #37015 they were installed there anyway.

This change switches the 'go install' command in TestPIE to instead
use 'go build', and switches TestInstall and TestCachedInstall
(which appear to be explicitly testing 'go install') to explicitly
request GOPATH mode (which does have a well-defined install target).

For #37015.

Change-Id: Ifb24657d2781d1e35cf40078e8e3ebf56aab9cc8
Reviewed-on: https://go-review.googlesource.com/c/go/+/416954
TryBot-Result: Gopher Robot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Run-TryBot: Bryan Mills <1c8aad60184261ccede67f5c63a0d2a3bf3c9ff4@google.com>
Auto-Submit: Bryan Mills <1c8aad60184261ccede67f5c63a0d2a3bf3c9ff4@google.com>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@google.com>

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