Switch to custom byte swapping function.

GCC builtins like __bswap_32 are not portable between versions.
We also use htole32 (on the other end of the pipe).
At present, it's only needed on a hub, which runs on little-endian Linux (which, even when 64-bit, uses a 32-bit int), but we should be portable in principle ...