Replication manager: fix occasional race conditions
Replication manager: fix occasional race conditions

Fix rare race conditions when making the transition of replication states.
These are likely to happen for very short lived replications like the ones in the
test suite, or when deleting or changing the replicator database during runtime.

These race conditions were added in the refactoring done in revision 1079483 (which
adapted the replication manager to the new replicator code).



git-svn-id: c1f8a8ec0b3bb2e99ab3413722f81f687760e79c@1085023 13f79535-47bb-0310-9956-ffa450edef68

fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb