flatpak: Fix some edge cases with respect to progress and state calculation
This MR is partially a resurrection of !373 (closed) in that it also solves the problem of properly setting an app back to installed after it was "updated" to have a missing runtime installed or an extension updated. The implementation here is different than in !373 (closed) (more robust I think) but also depends on Flatpak 1.7.3 or newer. This MR also covers propagating progress properly from a related ref to the main app, which we were not doing in the case that the main app doesn't need an update in its own right. Finally, this MR fixes the unit test for app extensions which was being skipped.
This MR includes the patches from !488 (merged) and !489 (closed) just to make development easier, but I can remove them if needed.
cc @pwithnall