runtime: turn "too many EPIPE" into real SIGPIPE

Tested on Linux and OS X, amd64 and 386.

R=r, iant
CC=golang-dev
https://golang.org/cl/4452046
diff --git a/src/pkg/runtime/freebsd/amd64/sys.s b/src/pkg/runtime/freebsd/amd64/sys.s
index 9a6fdf1..c5cc082 100644
--- a/src/pkg/runtime/freebsd/amd64/sys.s
+++ b/src/pkg/runtime/freebsd/amd64/sys.s
@@ -65,6 +65,18 @@
 	SYSCALL
 	RET
 
+TEXT runtime·raisesigpipe(SB),7,$16
+	// thr_self(&8(SP))
+	LEAQ	8(SP), DI	// arg 1 &8(SP)
+	MOVL	$432, AX
+	SYSCALL
+	// thr_kill(self, SIGPIPE)
+	MOVQ	8(SP), DI	// arg 1 id
+	MOVQ	$13, SI	// arg 2 SIGPIPE
+	MOVL	$433, AX
+	SYSCALL
+	RET
+
 TEXT runtime·setitimer(SB), 7, $-8
 	MOVL	8(SP), DI
 	MOVQ	16(SP), SI