refactor: use std::string for thread names
Summary:
This is a partial backport of core#25971
https://github.com/bitcoin/bitcoin/pull/25971/commits/97f5b20c12ca6ccf89d7720a5d41eaf4cda1b695
https://github.com/bitcoin/bitcoin/pull/25971/commits/26cf9ea8e44d7fd6450336f567afaedd1275baf7
Depends on D17705
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D17706