Fix filtering snaps after snapd 2.72
This patch assumed that a desktop snap Exec= line would always follow the
format Exec=env BAMF_DESKTOP_FILE_HINT=foo.desktop /snap/bin/foo arg1 arg2,
so it would interpret the third argument as the absolute binary path.
That was changed in snapd version 2.72 to remove the BAMF_DESKTOP_FILE_HINT
environment variable, so the Exec line now follows the format
Exec=/snap/bin/foo arg1 arg2.
The third argument is no longer the binary's absolute path, and things break.
Stop assuming that the binary path is the third argument, and instead iterate all arguments in-order until one matches the prefix "/snap/bin/".
LP: #2128350