Terminate all threads explicitlyThis is good style and might help with a mysterious deadlock observedin "extra-configs" CI.(cherry picked from commit c550639317c16851c91170d2111ca44ae1784f4b) (commit: 4c93dc0)