gc: disallow close on receive-only channels

Fixes #2353.
Fixes #2246.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5282042
diff --git a/test/chan/perm.go b/test/chan/perm.go
index 038ff94..af05445 100644
--- a/test/chan/perm.go
+++ b/test/chan/perm.go
@@ -48,4 +48,8 @@
 	case x := <-cs: // ERROR "receive"
 		_ = x
 	}
+	
+	close(c)
+	close(cs)
+	close(cr)  // ERROR "receive"
 }