Error in my_thread_global_end(): 2 threads didn't exit