VBufStorage: do not delete reference nodes prematurely when replacing subtrees (#10188)
* VBufStorage_buffer_t::replaceSubtrees: move all referenced nodes in a separate loop, before removing the replaced nodes from the backend. Otherwise, some referenced nodes might be prematurely deleted.
* VBufBackend_t::reuseExistingNodeInRender: remove the limitation that a node must be part of the same parent to be reused. This code did not handle descendants and the true underlying cause of crashes has been dealt with in vbufStorage_buffer_t::replaceSubtrees now.
* VBufBackend_t::reuseExistingNodeInRender: correct comment.
* VBufStorage_buffer_t::replaceSubtrees: rename some variables for better understanding and to avoid shadowing variables from an outer scope.