hashmap: make sure to initialize shared hash key atomically
if we allocate a bunch of hash tables all at the same time, with none
earlier than the other, there's a good chance we'll initialize the
shared hash key multiple times, so that some threads will see a
different shared hash key than others.
Let's fix that, and make sure really everyone sees the same hash key.
Fixes: #17007
(cherry picked from commit
ae0b700a856c0ae460d271bb50dccfaae84dbcab)
(cherry picked from commit
e662cf6d515daad19e70c3d85e244b213ac48997)