Use uintptr_t for casting pointers to integers

This fixes compilation on mingw-w64 and makes failing tests pass
on MSVC in 64 bit mode.
Merge pull request #642 from mstorsjo/win64-fix

Use uintptr_t for casting pointers to integers