netchan: fix locking bug.
There's no need to hold the client mutex when calling encode, since encode itself
uses a mutex to make the writes atomic.  However, we need to keep
the messages ordered, so add a mutex for that purpose alone.
Fixes #1244.

R=rsc
CC=golang-dev
https://golang.org/cl/2833041
1 file changed