Delegate updateShadow to event loop.
If PlasmaCore.Dialog resizes while visible, the kwin shadow property used by InternalWindow may update the shadow during rendering and cause crash related to current context.
Crash can be reproduced with https://invent.kde.org/xuetianweng/dialogtestscript and comment out NoBackgroundHint line. https://invent.kde.org/xuetianweng/dialogtestscript/-/blob/master/package/contents/ui/main.qml#L11