pumpChild's PTY.Read raced Session.Shutdown's PTY.Close on the master
field (Close set it nil while Read read it). Benign at process exit on
main, but the daemon now runs Shutdown routinely (daemon stop). Guard
the field with a mutex, capturing the fd under the lock and doing the
blocking I/O outside it so Close still unblocks an in-flight Read.
Caught under: go test -race -run 'Daemon|NetClient|Owner' -count=5.
- daemon_net: close the client transport on context cancellation so the
per-connection Recv loop unblocks; otherwise wg.Wait() in the accept loop
hung on a still-connected client and the daemon never stopped.
- protocol: guard ConnTransport.Send with a mutex so the subscriber pump and
command handlers can push frames concurrently without racing the bufio.Writer.
Fixes TestDaemonDetachReattachPreservesProcess (now passes under -race).