p2p, rpc: address relay fixups
Summary:
Move a use of statestats in getpeerinfo to within the section guarded by if (fStateStats), e.g. PeerManagerImpl::GetNodeStateStats true, and pass an in-param by reference to const.
This is a backport of core#22616
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D13348