Fix race condition: track sent items, rather than unsent items, so that a `send` operation that overlaps with processing of the transmit queue doesn't hang indefinitely.