Flush the progressbar.

If not flushed the progressbar can stay unresponsive for
quite some time. Other ways to flush the output are decribed
in https://stackoverflow.com/questions/230751
Merge pull request #114 from Krastanov/progress_flush

Flush the progressbar.