Instead of having BerkeleyEnvironment track the file use count, make
BerkeleyDatabase do it itself.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19335 | core#19335]] [2/5]
https://github.com/bitcoin/bitcoin/pull/19335/commits/4fe4b3bf1b152877677a6115f82aefaf318dd514
Depends on D10034