Terminate test thread before destroy.