Some changes for Windows support.

These are some small mixed changes taken from the code by alex85k at
https://github.com/alex85k/osmium . This gets rids of some of the
smaller issues. There are still lots of other issues to address for
the Windows version.