defensive coding with respect to giving names to threads

https://github.com/couchbase/couchbase-lite-android/issues/398
toString() for replication change

https://github.com/couchbase/couchbase-lite-android/issues/398