[Alt-Tab] Improve handling of closed window.