Safely kill child process on exit

Kept running into issues with the child process continuing to run after an uncaught exception.  Added a safety mechanism to deal with that.  I made sure to still print the stack trace, and wrap it in a `try` in case it was already closed.

I decided to kill the process on `SIGINT` and `SIGTERM`.  Although I'm not sure that it is necessary, I figured that it can't hurt.