Filter `CommonSetupFlags` more consistently in UnpackedPackage
In #10292, we will move the `--keep-temp-files` setting into
`CommonSetupFlags` and out of `ReplFlags`/`HaddockFlags`. This means
that the flag-filtering behavior (which adapts flags from new versions
of `cabal-install` to old version of `Cabal`) will need to know which
command is being run to provide the correct `CommonSetupFlags`.
Therefore, this change adds several new `filterFooFlags` functions to
provide this behavior, and removes the `commonFlags` used for all
subcommands in `Distribution.Client.ProjectBuilding.UnpackedPackage`.