Catch dead child processes

See discussion in #440 and #434 - this might address some of the issues

There's still some issues where events aren't triggered for dead children, but that bug has always been there, so let's fix separately