fix(util/rbtree): make sure traversal methods do not crash if given function updates the tree
fix(util/rbtree): make sure traversal methods do not crash if given function updates the tree

This is a fix for a nasty bug at `type_context::set_instance_fingerprint`.
This method traverses the local context `m_lctx` and invokes `is_class`
which may invoke `whnf`, and `whnf` may temporarily update the local
context. The local context is implemented using a `rb_tree`.
Note that the updates performed by `whnf` are temporary, but it
its representation in memory may be different.

digama0/lean,Kha/lean,Kha/lean,dselsam/lean,Kha/lean,leanprover-community/lean,digama0/lean,dselsam/lean,leodemoura/lean,fpvandoorn/lean,Kha/lean,leanprover-community/lean,dselsam/lean,leodemoura/lean,fpvandoorn/lean,leanprover-community/lean,digama0/lean,fpvandoorn/lean,digama0/lean,leanprover/lean,dselsam/lean,Kha/lean,leanprover/lean,digama0/lean,fpvandoorn/lean,leanprover/lean,leanprover-community/lean,leanprover-community/lean,leodemoura/lean,fpvandoorn/lean,leodemoura/lean,Kha/lean,leanprover/lean,fpvandoorn/lean,leodemoura/lean,digama0/lean,leodemoura/lean,leanprover-community/lean,leanprover/lean,dselsam/lean,leanprover/lean,dselsam/lean