Evaluating htons() at compile time is more efficient than doing ntohs()
at runtime. This change removes a dependency on a barrel shifter pass
before branch resolution, while reducing the instruction stream size
by 9 bytes on amd64.
(cherry picked from commit 6aee0bfa85685017dbc5050ce36793f7dcd80f82)