close child thread when main goes