dir: Support finding dependencies offline
dir: Support finding dependencies offline

Currently if you try to do an offline app install from a USB drive and
the app requires a runtime that's not already installed (or a different
version is installed), the install operation will fail, even if the
needed runtime is available on the USB drive.

The commit ensures that you can successfully find the dependencies
available from peer sources by making flatpak_dir_remote_has_ref() use
flatpak_dir_get_remote_state_optional(), which treats a summary fetch
error as non-fatal. Due to how flatpak_remote_state_lookup_ref() is
written, the summary is still required if there's not a collection ID
set on the remote.

This is a partial fix for https://github.com/flatpak/flatpak/issues/1583

Closes: #1673
Approved by: pwithnall

flatpak/flatpak,flatpak/flatpak,flatpak/flatpak,matthiasclasen/flatpak,matthiasclasen/flatpak,matthiasclasen/flatpak,flatpak/flatpak,flatpak/flatpak,matthiasclasen/flatpak,matthiasclasen/flatpak