xmlIsMainThread() doesn't work if libxml2 is initialized on a non-main-thread first
If libxml2 is initialized on a non-main thread first, then xmlIsMainThread() will return an incorrect answer since it assumes that libxml2 is always initialized on the main thread first.
This is easy to fix for platforms that support pthreads by using pthread_main_np().