Fix the build on Windows

Collateral damage: readdir_r isn't present in mingw, but bad old readdir
is fine for how we are using it.
Merge pull request #83 from mccoyst/windows

Fix the build on Windows