This is another small improvement taken from #10785.
Instead of manually converting from/to BE format in the CService serializer, provide a generic way in serialize.h to serialize BE data (only 16 bits for now).
---
This is a backport of Core [[https://github.com/bitcoin/bitcoin/pull/12916 | PR12916]]