builder: Handle app ids with dashes in them
builder: Handle app ids with dashes in them

An app id like org.domain.App-name is now allowed (dashes in the
last element), but blindly appending e.g. ".Locale" to these
for the locale extension will cause an invalid id.

In order to handle this we replace "-" with "_" in this case, which
should be fine as both are under the org.domain control which can
make sure there are no conflicts, and there is no requirement for
the id prefixes to exactly match.

This fixes https://github.com/flatpak/flatpak/issues/370

GeorgesStavracas/flatpak,GeorgesStavracas/flatpak,matthiasclasen/flatpak,handsome-feng/flatpak,flatpak/flatpak,GeorgesStavracas/flatpak,GeorgesStavracas/flatpak,matthiasclasen/flatpak,handsome-feng/flatpak,flatpak/flatpak,matthiasclasen/flatpak,flatpak/flatpak,matthiasclasen/flatpak,flatpak/flatpak,matthiasclasen/flatpak,GeorgesStavracas/flatpak,flatpak/flatpak,handsome-feng/flatpak,handsome-feng/flatpak,handsome-feng/flatpak