libide/tree: reset root node on invalidate

Merged Christian Hergert requested to merge wip/chergert/fix-tree-crash into main

This way we can skip a bunch of listmodel changes during the operations. It does require that callers re-expand what they care about though, since the old model doesn't really work safely.

See #2024 (closed) for the failure case.

Fixes #2024 (closed)

Merge request reports