try to fix stat()ing directories on windows in statcache code

Part of #476