Add missing htons() and properly cast ports to unsigned.

The first part, needed to get pcapplay without root powers going.