Issue24 - Perform application cleanup on pressing the window's "x" button

Fixes #24