Fixing build on MinGW

- Windows has no concept of group permissions nor other permissions on
files, therefore the code needed to be adjusted.

- There is no fcntl(...) system call in Windows.

- fsync(...) does not exist in Windows.
Merge pull request #1149 from cduclos/cf-update

Fixing build on MinGW