Create empty `.go` file in a random location (#3566)

Isolating the empty `.go` files generated for targets without sources
and removing them after a build turned out not to solve issues with
concurrent unsandboxed builds causing races. Instead, just generate the
file in a temporary location, which for a truly empty file does not
result in (non-hermetic) source file paths being included in the
archive.

Along the way fix a potential source of non-hermeticity in
`go_bazel_test`.
5 files changed