Add Darwin support

Ping @gkristic @ElPeque @JnBrymn @xaprb 

`ntohs` and `htohl` are implemented on Darwin as macros, and cgo doesn't like that. This adds a wrapper to both functions.