[cli] Move env var modification into init()

... so it applies to all tests in this package, and so the tests can go
back to using `t.Parallel()`.

Based on code review comments from
commit 247f7795e4fed68d3d4f6337de3020efb0dcd247.

Change-Id: Ibc5a0c47c492f8d4ac390d2413e0e7e493a5562f
Reviewed-on: https://fuchsia-review.googlesource.com/c/shac-project/shac/+/927992
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Fuchsia-Auto-Submit: Oliver Newman <olivernewman@google.com>
Reviewed-by: Anthony Fandrianto <atyfto@google.com>
diff --git a/internal/cli/main_test.go b/internal/cli/main_test.go
index 126d9be..b837c4e 100644
--- a/internal/cli/main_test.go
+++ b/internal/cli/main_test.go
@@ -71,16 +71,14 @@
 
 func init() {
 	helpOut = panicWrite{}
+	// Clear all environment variables to prevent automatic reporting mode
+	// selection, which can lead to inconsistent behavior depending on the
+	// environment.
+	os.Clearenv()
 }
 
 func TestMainErr(t *testing.T) {
-	// Override various env vars probed by `reporting.Get()` to prevent
-	// automatic selection of the reporter, which can lead to inconsistent
-	// behavior depending on the environment.
-	t.Setenv("LUCI_CONTEXT", "")
-	t.Setenv("GITHUB_RUN_ID", "")
-	t.Setenv("VSCODE_GIT_IPC_HANDLE", "")
-	t.Setenv("TERM", "dumb")
+	t.Parallel()
 
 	data := map[string]func(t *testing.T) (args []string, wantErr string){
 		"no shac.star files": func(t *testing.T) ([]string, string) {