ScriptPubKeyMan is only using UnsetWalletFlagWithDB to unset the blank
wallet flag. Just make that it's own function and not expose the flag
writing directly.
This does not change behavior.
https://github.com/bitcoin/bitcoin/pull/17304/commits/fc2867fdf50f47e5ad5f43445e500e3a477a8074
Depends on D7154
Partial backport of Core PR17304