RPC: Remove final comma for last entry of fixed-size Arrays and Objects in RPCResult
Summary:
JSON doesn't allow a trailing comma in Arrays/Objects
This is a backport of Core PR18444
Test Plan:
Look at the help message for a command that return a JSON object, and verify that the last item in the output example does not have a trailing comma
src/bitcoin-cli help getblockstats
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D8892