Added a dispose handler to make sure all particles are properly destroyed, no matter how the program is closed.

previously only worked when quitting by pressing ESC.