Fix infinite loop with LogPrint on Windows