GApplications: Tighten up application-id validity checks