A closed window cannot be activated, so guard relevant code paths to ensure that we don't hit this unexpected case. CCBUG: 438315 (cherry picked from commit 07a6b500)