Leave wallet/db.{cpp/h} for generic WalletDatabase stuff. The BDB specific stuff goes into bdb.{cpp/h}
Completes backport (5/5) of core PR19290:
https://github.com/bitcoin/bitcoin/pull/19290/commits/61c16339da4e80b1320a6296df6d96cd7a84bb4e
Depends on D8614.