Switch to the pthread handle to avoid any risk of NSThread instances changing during a thread's lifetime.