libthreads: add THREAD_* states