fix issue where log files are not written in binary mode under windows