Don't invoke undefined behavior when getting the pthread_t out of std::thread::id