qml: fix segmentation fault
There is a Qt bug which tries to access null pointers, and it causes Segmentation Fault.
The bug can be reproduced when switching content in a StackView when the old content contains Qt Quick ListView with sections.
Intends to be a temporary solution with no apparent negative effect for #25599 (closed), #25776 (closed).
Edited by Fatih Uzunoğlu