Fix compile error for Apple LLVM 4.2

Functions ntohll and htonll must be static because otherwise my
compiler complains.

(cherry picked from commit 2c3295a8d5b25375f2dbd9a945a8daf06c2e0d2f)