Flush the progressbar.

If not flushed the progressbar can stay unresponsive for
quite some time. Other ways to flush the output are described
in https://stackoverflow.com/questions/230751

NOTE: It seems my editor automatically removed trailing whitespaces and similar style issues. Should I revert this (I do not really know what your policy on style fixes is).