runtime: When in a Flatpak env try to get the right executables
When we are in a Flatpak environment we want to pick "localedef", "locale" and "ldconfig" from the Flatpak runtime instead of the ones provided by Scout/Soldier.
By searching in the PATH we can ensure to create a subsandbox where these executables are symlinked to the "/run/parent" counterpart.
Fixes: T27438
With this patch:
(steamrt soldier 0.20210406.0)ryuzaki@ryuzaki:/$ ls -l /usr/bin/locale*
lrwxrwxrwx 1 ryuzaki ryuzaki 26 Apr 9 17:03 /usr/bin/locale -> /run/parent/usr/bin/locale
lrwxrwxrwx 1 ryuzaki ryuzaki 29 Apr 9 17:03 /usr/bin/localedef -> /run/parent/usr/bin/localedef
(steamrt soldier 0.20210406.0)ryuzaki@ryuzaki:/$ ls -l /usr/bin/ldconfig
lrwxrwxrwx 1 ryuzaki ryuzaki 14 Apr 9 17:03 /usr/bin/ldconfig -> /sbin/ldconfig
(steamrt soldier 0.20210406.0)ryuzaki@ryuzaki:/$ ls -l /sbin/ldconfig
lrwxrwxrwx 1 ryuzaki ryuzaki 28 Apr 9 17:03 /sbin/ldconfig -> /run/parent/usr/bin/ldconfig