Bug fix pthread_detach