qt: fix sporadic crash when csd close button is clicked on windows
This crash seems to happen when the interface is in such state that the QML engine can be destroyed in a relatively short time. For example, I have not observed this before when a video is playing (we wait for player to stop in that case https://code.videolan.org/videolan/vlc/-/blob/master/modules/gui/qt/maininterface/mainctx.cpp#L809). But I was able to observe it when view models are empty: there are less items to destroy, thus it takes less time to destroy the QML engine.
This fixed the crash for me. I have only checked with GCC (what I have), but we can always re-open issues if they are not fixed fully.
Close #29094 (closed).
Request review @chub.