Test for thread deletion