Create Thread class

It intercept the function pointer passed to the pthread_create()
subroutine so that the thread_index can be inferred from each thread.