64bit win fix

This fixes a couple of variables that need to be sized properly for 64 bit compilation and makes sure that the mmap file is opened in binary mode on Windows