fuzz: Link all targets once
Summary:
Dramatically reduce the build time and the disk space consumption.
Backport of core#20560.
https://github.com/bitcoin/bitcoin/pull/20560/commits/44444ba759480237172d83f42374c5c29c76eda0
The second commit is not backported because it brings no value.
Also a backport of core#20733 otherwise the build fails due to duplicated symbols.
Test Plan:
Follow the doc from fuzzing.md, build with AFL and LibFuzzer, run the
fuzzer directly and via test_runner.py for LibFuzzer.
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Subscribers: PiRK
Differential Revision: https://reviews.bitcoinabc.org/D15145