Fix race condition

This will (hopefully) fix the error seen on the CI.

After we send_io to the application process, it checks if
watcher.stale?. If so, it exits. So it could happen that the child is
alive, we send the io, then the child is stale, so it exits, so there is
no pid, so the client exits with no output. What should actually happen
is that we detect the exit and restart the child.