[CMAKE] Add a check_linker_flag function
Separate the check of the flag from its addition. This has the
beneficial side-effect to discard the need for removing the Werror
flag from CMAKE_REQUIRED_FLAGS, since its scope is now reduced.
There is no change in behavior.
Run the Gitian builds
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, deadalnix, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D4961