I added a interruptible_wait_for_termination function, which will probably not work on NT, since I have no idea how to do that. But otherwise, I think it's usable. Comments and style tips are welcome. :-) I'm cargo-culting somewhat when it comes to Emacs C internals...