Add runtime check to see if htonll is already defined, e.g. for Mac OS X 10.10

This fixes a compilation error when installing on OS X Yosemite.