Fixes #993 to make one gen doc replicate faster.

Its an update of @jo commit made couple months ago to work with master. https://github.com/daleharvey/pouchdb/issues/993