flatpak: Introduce a utility to resolve default arch for refs
This is originated to address the case of external-appstream
that can be used to mention additional appdata for a given GsApp.
However, the source
parameter for a flatpak GsApp is dependent
on the arch of the system. This patch allows the external appstream
to optionally omit the arch and gnome-software will assume the
default arch and re-create the source parameter with the correct ref.
The corrected ref is parsed through flatpak_ref_parse
for sanity.
Example of an external appstream 'source' parameter resolution:
app/org.telegram.desktop//stable
resolves to: app/org.telegram.desktop/x86_64/stable
for a
x86_64 platform.