file: Fix cross-compilation on Darwin/macOS
Darwin/macOS does not have pipe2(2).
Apply a similar guard as in f3d7ace4b235422e5ccff0315f2965ac935241d8
after 43a5ec4eb41567cc92586503212743d89686d78f.
Pull Request: https://github.com/freebsd/freebsd-src/pull/574