[QDBusMenuBar] Guard m_window with a QPointer
It can be deleted without us knowing for MDI windows as happens in QtCurve config.
Also always update m_window if it changes, even when null.
BUG: 376340
BUG: 379719
FIXED-IN: 5.12.7
Differential Revision: https://phabricator.kde.org/D13774