Replace wantWriteFrameCh with a method.

Also add more notes about which goroutines things should run on,
and add another check which found a bug (potential deadlock) in Ping processing.