Fix iterator corruption when it is used to remove items from the avltree