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