Fixing Windows x64 warnings.

Started to look over windows 64 warnings after reading http://www.freelists.org/post/nanomsg/Problem-with-x64-build-on-windows,2

I tried to change the data types to some more appropriate where possible, and add a cast and assert otherwise.

In chunk.c there might be a better name for the `empty_space` variable.