[util] Replace use of locale dependent atoi(…) with locale-independent std::from_chars (C++17)
Summary:
Removes the usage of atoi, which is not locale-independent, and replaces it with a new function LocaleIndependentAtoi, which is.
- test: Add test cases for LocaleIndependentAtoi
- fuzz: Assert legacy atoi(s) == LocaleIndependentAtoi<int>(s)
- fuzz: Assert legacy atoi64(s) == LocaleIndependentAtoi<int64_t>(s)
Backport from core#20452.
Test Plan: ninja check, plus run fuzzers
Reviewers: Fabien, #bitcoin_abc
Reviewed By: Fabien, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D18472