[Backport] Fix leaking empty concurrent hashmaps (#2929) to maintenance

Backport of #2929