Fix a race condition on shutdown with hashmap.

Also, always need to init the blocks, they are not zero initialized.
Merge pull request #5924 from unknownbrackets/debugger

Fix a race condition on shutdown with hashmap