Call ReallocateCache() on each Flush()
Summary:
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
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D16177