init: Use size_t consistently for cache sizes
Summary:
This avoids having to rely on implicit casts when passing them to the
various functions allocating the caches.
This also ensures that if the requested amount of db_cache does not fit
in a size_t, it is clamped to the maximum value of a size_t.
Also take this opportunity to make the total amounts of cache in the
chainstate manager a size_t too.
This concludes backport of core#31483
https://github.com/bitcoin/bitcoin/pull/31483/commits/2a92702bafca5c78b270a9502a22cb9deac02cfc
Depends on D18583
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18584