Don't immediately flush after writing to log file

Gives some performance, but logs will not always be up-to-date.