Sanitize some wallet serialization
Summary:
Backport of PR12658 https://github.com/bitcoin/bitcoin/pull/12658/files
42343c748 Split up and sanitize CAccountingEntry serialization (Pieter Wuille)
029ecac1b Split up and sanitize CWalletTx serialization (Pieter Wuille)
Test Plan: make check
Reviewers: #bitcoin_abc, deadalnix, jasonbcox, Fabien
Reviewed By: #bitcoin_abc, jasonbcox
Maniphest Tasks: T635
Differential Revision: https://reviews.bitcoinabc.org/D2929