Partial backport (9/11) of core PR18918:
https://github.com/bitcoin/bitcoin/pull/18918/commits/9ea2d258b46e8a9776100633585ed0feede5c2a4
Depends on D8595.
The DBKeys declaration are added to the walletdb.h file to make them
available for salvage.cpp, see D7020.