Cleanup build warnings

Mostly these were warnings in the tests about signed/unsigned comparison mismatches.

Tested under gcc/linux, nacl-i686, nacl-x86_64, osx/darwin x86_64 (make and run unit tests)

There are a few other warnings I saw only from the osx build about unused functions (not actually unused) which I might fixup later.