Do not expose and consider -logthreadnames when it does not work
Summary:
There are conditions when the HAVE_THREAD_LOCAL macro is undefined what causes the -logthreadnames option does not work -- instead of thread names empty strings [] only are printed in the debug.log file.
This PR does not exposes the -logthreadnames option in such cases.
This is a backport of core#18665
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9918