Build on Windows

Swap stat()/S_ISREG with GetFileAttributes() via a preprocessor conditional.
Tested with Visual Studio 2012 Express and Visual C++ 2008 Express on
Windows 7.