With these new functions all vpwallets usage are removed
and vpwallets is now a static variable (no external linkage).
This is a partial backport of Core PR13017 : https://github.com/bitcoin/bitcoin/pull/13017/commits/373aee26c3df233f4e0a7e806f45ac7cb5aab1e6