GsPluginLoaderSync: don't iterate the default main context

The default main context can be iterated only from the default thread
(because it includes Gdk/Gtk sources), so it cannot be used from
threadsafe methods.

https://bugzilla.gnome.org/show_bug.cgi?id=707185
Fix thread safety issues in the plugin loader

Protect with mutexes all the struct members that are accessed from
multiple threads, and make sure that signals handled by the view
are emitted in the main thread.

https://bugzilla.gnome.org/show_bug.cgi?id=707185
datadir-apps: fix desktop files with multiple dots

We must only remove the last .desktop, otherwise app IDs in
reverse DNS notation get stripped to the first component.

https://bugzilla.gnome.org/show_bug.cgi?id=707185
datadir-filename: look in all system directories for desktop files

This makes it possible to show information for applications installed
in other locations or through systems different from PackageKit
(for example jhbuild or listaller)

https://bugzilla.gnome.org/show_bug.cgi?id=707185
packagekit-refine: don't set an error if we don't find the package

It's possible that no package is found because the application
was installed through a mean different than PackageKit. In that
case we should not set an error, to avoid aborting the entire
plugin transaction.

https://bugzilla.gnome.org/show_bug.cgi?id=707185
Fix thread safety issues in the plugins

The plugins are all run in worker threads, so shared data structures
must be protected with locks, and initialization must be protected
with GOnce.

https://bugzilla.gnome.org/show_bug.cgi?id=707185
appstream: don't use gzip to decompress the zip file

It's a terrible idea to use predictable names in /tmp, and in
general we don't need to spawn an external binary, we can use
GIO for the same.
Also, improve the thread safety with GOnce instead of GMutex.

https://bugzilla.gnome.org/show_bug.cgi?id=707185
GsPluginLoader: fix sorting the priorities

Need a C style sort function (-1, 0, 1), not C++ (<)

https://bugzilla.gnome.org/show_bug.cgi?id=707185
appstream: mark applications as available when no better state is set

We coming from the hardcoded plugins, instead of packagekit, we
don't know the installed state, so assume the app is available.
Also, increase the priority, so appstream is run after datadir-apps
(which also sets the installed state).

https://bugzilla.gnome.org/show_bug.cgi?id=707185