[NFC][tsan] Move thread create/start/join/detach bookkeeping into helpers (#238276)

Move the parts of the pthread_create, pthread_join and pthread_detach
interceptors, and of __tsan_thread_start_func, that don't depend on the
pthread API into ThreadCreateCommon, ThreadStartCommon, ThreadJoinCommon
and ThreadDetachCommon.

This prepares for intercepting the C11 thrd_* functions on glibc
(#199585). glibc's thrd_create, thrd_join and thrd_detach call its
internal pthread functions directly, so they bypass these interceptors.

Assisted-by: Claude
GitOrigin-RevId: eaa9470aafce5f483c8b679d0f0acefc44876b40
1 file changed