Simplified thread cleanup.