walletdb: Introduce AddRef and RemoveRef functions
Summary:
Refactor mapFileUseCount increment and decrement to separate functions
AddRef and RemoveRef
This is a backport of core#19334 [2/4]
https://github.com/bitcoin/bitcoin/pull/19334/commits/71d28e7cdca1c8553531bb3a4725d7916363ec5c
Depends on D10022
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D10023