Improved application exit, I hope this fixes that sporadic bug where
the process lives on as a zombie because of some weird deadlock...