Fix crash when reading scale factor after window has been destroyed

Ideally we should cancel all pending operations when the main window
has been destroyed, but that will require a more intrusive change. I am
uncomfortable making such a change in a stable bug-fix release unless
I can reproduce this scenario to ensure that it does not regress
anything.

https://bugzilla.gnome.org/show_bug.cgi?id=738527