flatpak: Set apps to installed upon missing runtime install

This commit is a rework of
!373

The idea is that when an app's runtime is missing, or one of its
should-download related refs is missing, the app will be returned as
updatable by flatpak_installation_list_installed_refs_for_update(), and
will be subsequently added to a transaction by gnome-software. Progress
updates on the app are calculated using the progress of the related
operations. However if the app itself doesn't need an update,
_transaction_operation_done() will never be called for it and so its
state never gets set to AS_APP_STATE_INSTALLED. Fix this by setting the
app to installed when the related thing is, if the app is being skipped
and the related thing is the last operation in the transaction needed
for the app.

It would be great to add a unit test for this, but there's no way
through the flatpak plugin's API to uninstall an app's runtime without
uninstalling the app, so we'd have to do something tricky like call out
to "flatpak uninstall --force-remove ..."
2 jobs for fix-flatpak-related-progress in 4 minutes and 12 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #830182
debian-stable-x86_64

00:01:27

passed #830181
fedora-x86_64

00:04:12