libtracker-data: Protect tracker_sparql_execute_cursor() with a mutex

This function used to operate 100% on readonly data, so could be safely
used from multiple threads. This is however no longer true since commit
af97cede, which might result in TrackerSparql churning again to
re-parse the SPARQL into SQL.

Moreover, as this was not an atomic operation (far from it), the same
TrackerSparql could trigger independently this re-parsing, or surprise
older users with data going down their feet. This could produce anything
from wrong results, to invalid reads/writes, to crashes.

Protect the whole thing with a mutex, so it is ensured it's only rebuilt
in one thread, and other users don't get surprised by it.
3 jobs for wip/carlosg/timeouts-and-stuff in 1 minute and 14 seconds
Status Job ID Name Coverage
  Test
passed #793561
test-alpine-edge

00:01:00

passed #793562
test-fedora-latest

00:00:58

passed #793563
test-ubuntu-rolling

00:01:13