[Debugger] Optimization *and* bugfix in one! Don't refresh the tree if nothing changed

Fixes bug #17162