Windows / mingw build fixes

The current libstatgrab does not build with Windows / mingw properly due to general refactoring leaving it behind. This set of changes gets Windows support back into buildable shape, though there is still more to do to get it fully functional.

Build tested with the mingw cross compiler on Ubuntu 14.04.

./configure --host=i686-w64-mingw32 --disable-thread-support --disable-examples --disable-man-build
make

You can even test with wine if you don't have an actual Windows host:
wine ./src/statgrab/statgrab.exe