send App.quit correctly when the last window closed