Attempt to fix closing all threads on exit()