Fix windows build. The statbuf.st_mode in windows contains only a limited number of bitmask constants:
http://msdn.microsoft.com/en-us/library/aa273367(v=vs.60).aspx