Make kill wait for child process to exit, to add support for asynchronous signal handlers