util: Replace non-threadsafe strerror
Summary:
Some uses of non-threadsafe strerror have snuck into the code since
they were removed in #4152. Add a wrapper SysErrorString for
thread-safe strerror alternatives and replace all uses of strerror
with this.
Add strerror to the locale-dependence linter to catch its use.
Add an exemption for strerror.cpp (the only allowed use).
Also fix a bug in the regexp so that _r and _s variants are detected
again.
This is a partial backport of core#24933
https://github.com/bitcoin/bitcoin/pull/24933/commits/46971c6dbfbc39ebbc74ab1ed8c00edc12859373
https://github.com/bitcoin/bitcoin/pull/24933/commits/e3a06a3c6cbb288ac89a2725cf71ae8adaebf35c
Depends on D16208 and D16212
Test Plan:
ninja all check-all
Check that the linter catches occurences of strerror
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D16209