This avoids a pop-up box on OS X and it avoids
a test failure if something is using 5555.
I apologize for not noticing this during the review.
TBR=r
CC=golang-codereviews
https://golang.org/cl/152320044
The nicest solution would be to buffer the message and only write
it if it encodes correctly, but that adds considerable memory and
CPU overhead for a very rare condition. Instead, we just shut
down the connection if this happens.
Fixes#7689.
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/146670043