[tsan] fix thread_name.cc test to work with older versions of libc