Only #include upstream bdb headers from our cpp files.
It's generally good practice to avoid including 3rd party deps in headers as otherwise they tend to sneak into new compilation units. IMO this makes for a nice cleanup.
There's a good bit of code movement here, but each commit is small and should be obviously correct.
Note: in the future, the buildsystem can add the bdb include path for bdb.cpp and salvage.cpp only, rather than all wallet sources.