Improvements to runloop task scheduling & live queries

* CBLLiveQuery no longer makes redundant queries when the database
  hasn't changed since the last query.
* -[CBLQuery waitForRows] no longer waits in the default runloop mode,
  as this can cause nasty re-entrant calls when user events arrive.
  Instead, we use a custom runloop mode.
* Added a utility method -[CBLDatabase waitFor:] to encapsulate this
  improved waiting behavior.
* Don't use dispatch-queue mode on the main thread. In dispatch-queue
  mode, operations like waitForRows are impossible because you can't
  do the equivalent of spinning a nested runloop.
Fixes #477