Fix memory leaks (reference cycles) in replicator

Fixes couchbase/couchbase-lite-ios#37