Allows cleaner exit when closed 

Before, closing the app left the processes just hanging. This patch allows the program to exit cleanly when closed from another source.
Merge pull request #8 from elken/patch-1

Allows cleaner exit when closed