net: Improve and document SOCKS code
Summary:
Make the SOCKS code more consistent, and document the constants used.
This is a backport of Core PR11397
Depends on D1872
Test Plan:
make check
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Subscribers: jasonbcox, teamcity
Differential Revision: https://reviews.bitcoinabc.org/D1873