gom: Don't use GSimpleAsyncResult in worker thread

Using GSimpleAsyncResults in the worker thread makes it
impossible to chain calls inside the SQLite thread, making
it hard to implement reliable synchronous calls.

Instead, we'll use our own structure, so that the callbacks
passed to the worker thread will be responsible for sending
out results through GSimpleAsyncResult if they want to use
such a construct.
gom: Prevent SQLite accesses from the main thread

This isn't foolproof, but this ensures that the db struct
member isn't fetched (usually before it's used), or that
SQL commands aren't run from the main thread instead of
from the SQLite thread.
gom: Make sure sync calls use the SQLite worker thread

The sync calls would make SQLite calls outside the SQLite thread.
As this can lead to very bad things happening, use a GAsyncQueue
to wait (and block) for the asynchronous call to finish.
gom: Remove dummy_cb functions

g_simple_async_result_new() handles NULL callbacks just fine.
gom: Add sync versions of the open/close functions

This makes it easier to deal with databases that are bound to
an object's lifecycle.
gom: Fix leak when building commands

g_object_class_list_properties() transfers the container, so
don't forget to free it.
gom: Simplify array concatenation in filter

The values in the source array aren't freed, so don't bother
copying the values, we'll assume ownership.
gom: Set clear function for values arrays in filter

Otherwise we'll leak the contents of the array when we use
g_array_free() with free_segment = TRUE.
gom: Fix command leak when querying the DB version
gom: Fix mem leak in find_{sync,async} functions

Both were leaking the async result.
tests: Fix small leak in filter creation
gom: Fix worker thread being leaked
gom: Fix g_async_result_get_source_object() usage

g_async_result_get_source_object() returns a reference to the
object, so don't forget to unref it.
gom: Correct gom_resource_fetch_m2m_finish() return type

Fix cyclic dependency problem when making
gom_resource_fetch_m2m_finish() actually return a GomResourceGroup
rather than a gpointer.

This is necessary to avoid problems in the future with languages
that use the introspection data.
gom: Separate callback data from user_data

Add a "migrator_data" argument to gom_repository_migrate_async()
so that the user_data passed to the GIO async callback doesn't
need to be the same as the one passed to the migration function.
gom: Add gom_repository_migrate_sync()
gom: Fix link in gom_adapter_open_async() docs