Fixes #771: Makes the ProgressBar usable as a generator.