fix fdatasync on OS X