[WIN32] replace old dirent emulation to a more complete one. Even though I can't find where its still in use I feel better with a working solution.
Merge pull request #2552 from wsoltys/dirent

[WIN32] replace old dirent emulation with a more complete one.