Merge "Fix bug in pthread_join, pthread_exit, pthread_detach"