[tor-commits] [stem/master] Fixing testing thread leak and adding check for it