Flush stream when logging to standard output

Print everything in the stdout buffer immediately.
Merge pull request #158 from plfiorini/flushlog

Flush stream when logging to standard output