util: Detect posix_fallocate() instead of assuming
Summary:
Don't assume that `posix_fallocate()` is available on Linux and not available on other operating systems. At least FreeBSD has it and we are not using it. Properly check whether `posix_fallocate()` is present and use it if it is.
Backport of core PR18437.
Test Plan:
ninja grep HAVE_POSIX_FALLOCATE src/config/bitcoin-config.h
Check the HAVE_POSIX_FALLOCATE value is as expected (should be 1 on
linux).
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9108