hash.c: Avoid using fdatasync on macOS
The symbol exists but is not advertised in headers when using clang provided by homebrew or MacPorts and thus compilation is failing.
Apply same fix as in https://trac.macports.org/ticket/70070 to resolve the issue.