Assume the window is closed on "can't access dead object" error.

Fixes issue 5237.