[CI] Use proper argument handling in build_cmake.sh
Summary:
D6315 was branching on $1 to check for an option but will fail due to
unbound variable (set -u) if no argument is set.
This diffs use proper handling to avoid the issue and make later
improvements easier.
Test Plan:
Run the build-clang-10 CI build, or any other using the --Werror
option.
Run the build-osx CI build, or any other not using the --Werror
option.
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Subscribers: jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D6325