Instead of opening the Db handle in BerkeleyBatch, make BerkeleyDatabase
do that.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19335 | core#19335]] [3/5]
https://github.com/bitcoin/bitcoin/pull/19335/commits/d86efab37002841fd059251672e1ec1a977b743f
Depends on D10035