Complete issue #120

- Port the fix for the issue couchbase/couchbase-lite-java-core#95. The
fix ensures that the last sequence will be updated correct in the case
that one of the lower sequence doc (esp with the attachment) is failed
while being uploaded to the sync gateway.
- Port ReplicationTest. TestPushReplicationCanMissDocs().