[CI] Improve error catching and build log verbosity
Summary:
Avoid missing errors from pipes and make the script print itself as it
runs. This will make the build logs more verbose and easier to debug
should an issue occur.
Test Plan: Run the CI build and gitian build, and check there is no error.
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Subscribers: jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D3992