Improve coverage on compat_*threads and workqueue

See my branch thread_coverage. It solves some but not all of #16798 (moved)