Stop threads on instance exit