Refactor FormatStateMessage() to better match Core
Summary:
This completes the backport of Core PR16688 (see my note in the summary of D6652).
We diverge slightly due to a not-yet-backported change that will remove the RejectCode.
Depends on D6860
Test Plan: ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D6862