Implemented the posix::gettid() function.
Ensured posix::gettid() memoizes its result in a thread-local.