Add as_app_has_category()

It's used in GNOME Software and now createrepo_as, so move it here.