Construct CWalletTx objects in CWallet::CommitTransaction, instead of
having callers do it. This ensures CWalletTx objects are constructed in
a uniform way and all fields are set.
This also makes it possible to avoid confusing and wasteful CWalletTx
copies in https://github.com/bitcoin/bitcoin/pull/9381
There is no change in behavior.
Partial backport of core PR9680 (commit a128bdc)
Depends on D2611