Fix GH-11222: foreach by-ref may jump over keys during a rehash Signed-off-by: Bob Weinand <bobwei9@hotmail.com>