Windows build fix: ignore pthread.h if it exists (#4989)