Delete persistent replication when its source/target database is deleted

This used to work in TouchDB, but regressed a while ago, I think during the conversion
to Couchbase Lite.
Fixes #146