Added fflush to logger. It is just a Windows hack

to print the log data directly. Mingw buffers the data and write it when
the buffer is full. This is sometimes not good for accidental crashes.