Persistant application on Mac OS X

fixes issue 936 - application stays open after the last window has been closed on Mac OS X