This frees up all associated memory with the map, not only the nodes.
This is necessary in preparation for using the PoolAllocator for
CCoinsMap, which does not actually free any memory on clear().
This is a partial backport of core#25325
https://github.com/bitcoin/bitcoin/pull/25325/commits/5e4ac5abf54f8e6d6330df0c73119aa0cca4c103
Depends on D16176