net: improve encapsulation of CNetAddr
Summary:
Do not access `CNetAddr::ip` directly from `CService` methods. This improvement will help later when we change the type of `CNetAddr::ip` (in the BIP155 implementation).
Backport of core PR19360.
Depends on D9169.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9171