Fix warnings in C extension to compile on newer versions of GCC

This fixes the warnings found when compiling the extension on both Red Hat 6 and Debian Wheezy.