window: Do not restore shortcuts on a NULL window
The "force restore shortcuts" being triggered by a key-combo, there is no guarantee that the window is actually non-NULL in which case we would crash.
Make sure the window is not NULL before trying to invoke the associated class method.
Closes: #464 (closed)