Fix data race on Channel.send

Moving the mutex after Channel.send fixed the deadlock, but it revealed
a data race when updating send with sendClosed in Channel.shutdown.
Instead, schedule the shutdown after the write has finished.