htontcp{4,6} and ntohtcp{4,6} have a lot of duplicate code. This commit
pulls out the common option and block allocation code. We might be able to
do something with checksum offload and other bits in the future.