[libc] Handle PTHREAD_NULL in pthread_equal (#227856)

POSIX.1-2024 specifies that pthread_equal must accept PTHREAD_NULL for
either or both arguments. Previously, Thread::operator== dereferenced
attrib->tid, which crashed when passed a null or zero-initialized
pthread_t.

Compare Thread::attrib pointers directly in an inline constexpr
operator== in thread.h, matching how Thread::join and
pthread_getunique_np identify threads. Added PTHREAD_NULL test cases to
pthread_equal_test and updated file headers in the touched files.

Assisted-by: Automated tooling, human reviewed.
GitOrigin-RevId: e61a355ea7dad6311139bef70e0562d75c6fed1c
3 files changed