Fixes crash problem when local database pointer becomes nil during the
POST _rev_diffs stage of a push replication (see TDPusher -processInbox).
The test added in the previous commit reproduced this crash.

The TDReplicator -databaseWasDeleted and -databaseClosing are now queued
onto their own thread instead of running on the thread from which
they were called. This ensures proper functioning and ordering of
exectution steps when shutting down TDReplicators after either of these
events occur. It should fix a few bugs that crash, as reported by
users and seen by running tests.

A side-effect, however, is that when a database is deleted during
replication, a number of asynchronous operations are performed after
the database has been removed from local disk. This results in a
significatn number of error messages in the console produced by FMDB library.