Fix free lifetime vars in HashMap's iterators

Fixes #17500 
When we end up moving to randomized layout for all structure not marked `#[repr(C)]`, this may cause this transmute to go awry. Could this take a similar strategy as vectors and transmute to a `'static` lifetime?