local-ratings: Do not attempt to look up a NULL application ID
Tweak the priorities so the pkgname->app_id is done before the rating lookup

The local ratings plugin uses the application ID, rather than the package name
to look up the user-set rating.
Ensure that the application ratings are set correctly