Fixes #131 by porting iOS changes.  Unit test now passing.

https://github.com/couchbase/couchbase-lite-java-core/issues/131