[rpc] refactor: consolidate sendmany and sendtoaddress code
Summary:
The only new behavior is some error codes are changed from -4 to -6.
This is a backport of core#18202
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9993