Fix fix_iterator hang
When fixing the iterator, when every leaf on this branch is greater than the one we wanted we go back to the parent branch and iterate back to the predecessor from that point.
But if there are no more previous leafs, it means the queried name precedes the entire range of names in the database, so we would just move the iterator one step back and continue from there.
This could end in a loop because the queried name precedes the entire range of names and so none of those names are the predecessor of the queried name.
Closes #4622 (closed) Closes #4632 (closed)
Edited by Matthijs Mekking