runtime: reset GOMAXPROCS during tests

Fix the fact that the test leaves GOMAXPROCS=3
and a running goroutine behind.

R=golang-dev, rsc
CC=dvyukov, golang-dev
https://golang.org/cl/4517121
diff --git a/src/pkg/runtime/proc_test.go b/src/pkg/runtime/proc_test.go
index a15b2d8..cac4f9e 100644
--- a/src/pkg/runtime/proc_test.go
+++ b/src/pkg/runtime/proc_test.go
@@ -24,20 +24,23 @@
 		t.Logf("skipping during short test")
 		return
 	}
-	runtime.GOMAXPROCS(3)
-	compl := make(chan int, 1)
+	maxprocs := runtime.GOMAXPROCS(3)
+	compl := make(chan bool, 2)
 	go func() {
 		for i := 0; i != 1000; i += 1 {
 			runtime.GC()
 		}
-		compl <- 0
+		compl <- true
 	}()
 	go func() {
 		for i := 0; i != 1000; i += 1 {
 			runtime.GOMAXPROCS(3)
 		}
+		compl <- true
 	}()
 	go perpetuumMobile()
 	<-compl
+	<-compl
 	stop <- true
+	runtime.GOMAXPROCS(maxprocs)
 }