Several fixes regarding .flatpak* files
- Do not crash when using a flatpakref file
- Also addresses an issue when opening .flatpakrepo files
- Discover uses the full repo instead of the trimmed resource in case it's a well-known repository.
I'd like to backport the 3 fixes to 5.23.