Make gen-manpages.sh return non-zero if the script fails at any point
Summary:
The script can fail if one of the binaries doesn't exist or cannot be run for some reason,
but these failures do not cause the script to return a non-zero exit code.
This patch makes the script return non-zero for these cases as well as cleaning up correctly.
Test Plan:
cd build ninja cd .. BUILDDIR=$PWD/build contrib/devtools/gen-manpages.sh # succeeds rm build/src/qt/bitcoin-qt BUILDDIR=$PWD/build contrib/devtools/gen-manpages.sh # fails
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D5360