Avoid deadlock in race condition

Don't wait for run to send bytes if it has already exitted.

And also add a bunch of diags because we think someone is calling close
to early.