libthreads: add thread_current() function