Add support for state=latest to flatpak module (#8221)
Fixes#6563 by extending the allowed values of the `state` parameter to
include `latest`. To do this, the `update_flat()` function is introduced
which borrows the majority of its implementation from both the existing
`install_flat()` and `remove_flat()` functions. The documentation and
examples have been expanded describing what to expect when using
`state=latest`.
(cherry picked from commit 0735656319)
Co-authored-by: Kenneth Benzie (Benie) <k.benzie83@gmail.com>