fix bug leading to losing of hash entries in hash_iter_next