installation: Cache remote states while querying installed refs
installation: Cache remote states while querying installed refs

Cache remote state so that each remote is only queried once
for getting its state.

Follow up from https://github.com/flatpak/flatpak/pull/3204#discussion_r349642324

flatpak/flatpak,flatpak/flatpak,flatpak/flatpak,flatpak/flatpak,flatpak/flatpak