init: Setup scheduler in tests and init in exactly the same way
test: Set -logthreadnames in unit tests
PR description:
Generally the unit tests are single threaded, with the exception of the script check threads, the schedule, and optionally indexer threads.
Like the functional tests, the thread name can serve additional debug information, so set -logthreadnames in unit tests.
This is a backport of core#19028