Segmentation fault when create the thread