refactor: Cleanup thread ctor calls
Summary:
refactor: Make TraceThread a non-template free function
Also it is moved into its own module.
refactor: Use appropriate thread constructor
refactor: Replace std::bind with lambdas
Lambdas are shorter and more readable.
Changes are limited to std::thread ctor calls only.
This is a backport of core#19064
Notes:
- The mapport source file does not exist because we are missing core#18077
- D11828 added an argument for CConnman::ThreadOpenConnections
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12068