fix infinite loop in windows when trying to read json variant from empty file