Fix free lifetime vars in HashMap's iterators

Fixes #17500 
The type checker requires `'static` bounds on parameters otherwise, just like in `Vec`.
```
688:27 error: the parameter type `K` may not live long enough; consider adding an explicit lifetime bound `K:'static`...
688:27 note: ...so that the reference type `&collections::hashmap::table::RawTable<K,V>` does not outlive the data it points at