Due to bugs in ostree (see
e.g. https://github.com/flatpak/flatpak/pull/3524) it sometimes
happens that we download more data than we expect to. This isn't
great, but when it happens its better to limit the progress to 100%
anyway to avoid breaking apps (for example, the flatpak CLI doesn't
really handle this very well).
I noticed several places in flatpak-dir.c that didn't check for
NULL progress, so lets move the check inside the implementation so
we can ensure its always checked.
To avoid the complexities of passing (and chaining) OstreeAsyncProgress
objects around, we only create one just before calling to ostree.
The rest of flatpak only ever uses the new FlatpakProgress object.
Co-authored by: Philip Chimento <philip@endlessm.com>