Fix cpp-if check for POSIX threads