Fix infinite loop with LogPrint on Windows #2