core: Fix FOLKS_DISABLE_LINKING

The second step of the _add_personas() function looks at candidate_inds,
which is currently populated even if linking is disabled (in a failed
attempt to keep all the FOLKS_DISABLE_LINKING logic to a single
if-statement at the bottom of the function).

This patch takes a different approach, and ensures that candidate_inds
is not populated if FOLKS_DISABLE_LINKING is enabled, adding an
assertion to try and prevent this bug being re-introduced in future.

A test case will be added in a future commit (see the bug report).

https://bugzilla.gnome.org/show_bug.cgi?id=727405
dummy: Fix dummy test cases to allow more than one test to run

https://bugzilla.gnome.org/show_bug.cgi?id=727405
tests: Add an assertion that the main context is empty on tear_down

Leaving the global default main context with pending events is a common
cause of cross-test interference which can cause spurious test failures.
Try and ensure there are no pending events at the end of each test’s
tear_down function.

https://bugzilla.gnome.org/show_bug.cgi?id=726973
tests: Manually iterate main context on tear_down in various tests

The code under test in these cases doesn’t (yet) correctly ensure there
are no pending events before returning. To avoid assertion failure,
manually iterate the global default main context until all pending
events have been handled, then continue to tear_down.

In future, it would be better to fix the tests and backends themselves
to not leak main context events after unprepare() has been called.
See https://bugzilla.gnome.org/show_bug.cgi?id=727700.

https://bugzilla.gnome.org/show_bug.cgi?id=726973
bluez: Ignore missing sessions when removing sessions

This occasionally happens when running the unit tests. The check only
applies to unit tests, so will have no effect in production use.

https://bugzilla.gnome.org/show_bug.cgi?id=726973
eds: Only use enabled ESources from EDS

Don’t ignore the enabled/disabled state of the ESource. When EDS sources
(such as the Google Contacts address book) are toggled in GOA, they’re
disabled, not removed. Folks needs to respect that.

https://bugzilla.gnome.org/show_bug.cgi?id=722579
tests: Manually iterate main context on tear_down in Dummy tests

The code under test in these cases doesn’t (yet) correctly ensure there
are no pending events before returning. To avoid assertion failure,
manually iterate the global default main context until all pending
events have been handled, then continue to tear_down.

In future, it would be better to fix the tests and backends themselves
to not leak main context events after unprepare() has been called.

https://bugzilla.gnome.org/show_bug.cgi?id=726973
tests: Manually iterate main context on tear_down in Dummy tests

The code under test in these cases doesn’t (yet) correctly ensure there
are no pending events before returning. To avoid assertion failure,
manually iterate the global default main context until all pending
events have been handled, then continue to tear_down.

In future, it would be better to fix the tests and backends themselves
to not leak main context events after unprepare() has been called.
See https://bugzilla.gnome.org/show_bug.cgi?id=727700.

https://bugzilla.gnome.org/show_bug.cgi?id=726973
core: Rate-limit AvatarCache.store_avatar() to prevent FD exhaustion

If connecting to a new EDS address book, or doing something else which
may cause a torrent of AvatarCache.store_avatar() calls, it is possible
to hit the operating system’s file descriptor limit, which causes
further store operations to fail.

Implement a simple FIFO rate limit on concurrent
AvatarCache.store_avatar() calls to try and ensure this won’t happen. It
is still possible if the process calls store_avatar() several times
while already near the FD limit, but then failure is pretty inevitable
anyway, and is already handled gracefully.

The changes are implemented in a self-contained wrapper function around
store_avatar(), and only result in memory allocations in the queueing
case.

A test case is included. This does not affect the AvatarCache API or
ABI.

https://bugzilla.gnome.org/show_bug.cgi?id=705742
tests: Fix enable-disable-stores EDS test

The test was occasionally spuriously failing because the persona stores
were being prepare()d after being re-enabled, and these prepare() calls
were being suspended part-way through when the test finished and killed
its main loop. They were being resumed when the main loop was re-started
during tear down — it’s re-started to wait for the singleton D-Bus
connection to be destroyed, so the prepare() calls ended up consistently
having their D-Bus connection drop out from beneath them, resulting in
warnings. These warnings would normally be useful to have, but not in
the middle of a unit test.

Fix this by rearchitecting the test slightly to force each persona store
to be prepared after being re-enabled. Also simplify how this is
tracked.

https://bugzilla.gnome.org/show_bug.cgi?id=726973
Updated Italian translation
Don't hard-code the Tracker major version for tests
eds: Fix crash on handling invalid birthday dates from contacts

If a GDateTime cannot be constructed due to the requested date being
invalid or out of range, the constructor will return null. The code was
not previously handling this.

https://bugzilla.gnome.org/show_bug.cgi?id=727944
telepathy: Fix crash on handling invalid birthday dates from contacts

If a GDateTime cannot be constructed due to the requested date being
invalid or out of range, the constructor will return null. The code was
not previously handling this.

https://bugzilla.gnome.org/show_bug.cgi?id=727944
tracker: Fix crash on handling invalid birthday dates from contacts

If a GDateTime cannot be constructed due to the requested date being
invalid or out of range, the constructor will return null. The code was
not previously handling this.

https://bugzilla.gnome.org/show_bug.cgi?id=727944
tests: Add assertions to check for null DateTimes

If the DateTime would end up being invalid, construction fails and null
is returned. Gracefully catch that in the unit tests.

https://bugzilla.gnome.org/show_bug.cgi?id=727944
Updated Indonesian translation
bluez: Add a test for an empty ‘FN’ attribute

This has tripped up other vCard parsers in the past. Thankfully, it
seems fine with EDS for us.
Update test CMs for telepathy-glib 0.99.11
Merge remote-tracking branch 'origin/master' into next