Make libfuzzer to work on macOS
Summary:
This makes it possible to build with libfuzzer on macOS (PR18008), fix
the issue that this PR introduced for other platforms (PR19366) and add
the corresponding documentation (PR17942).
This is a backport of core PR17942, PR18008 and PR19366.
Test Plan:
On macOS, read the documentation and follow the instructions.
I only ran the instructions for libfuzzer.
ninja bitcoin-fuzzers ./test/fuzz/test_runner.py <path_to_corpus>
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D8956