fix(desktop): close the window before quit cleanup (#6562)