refactor: Fix implicit-signed-integer-truncation in cuckoocache.h
Summary:
This is a backport of core#23626
Depends on D12799
Test Plan:
With UBSAN
ninja && ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12812