Terminate app when all windows are closed