pthread_t pid_t compatibility fixes