Handle Unix window close event