Fix potential user-after-free when removing nodes from the graph
When removeFromGraph() orphans its direct children it must also clear
their rootNodeRef, just as removeChild() does for the removed node
itself. Without the fix, an orphaned node P retains a live
rootNodeRef. If the root is then destroyed and a grandchild C calls
removeFromGraph() it will execute P->removeChild(C), which accesses
P->rootNodeRef via QSSGRenderRoot::get() causing a use-after-free crash.
Pick-to: 6.12 6.11
Task-number: QTBUG-145409
Change-Id: I65078c4726b6af83cd5d71d36bfe249077910495
Reviewed-by: Andy Nichols <andy.nichols@qt.io>