retry replication when it fails

This patch is to compensate bug reported here. 
https://issues.apache.org/jira/browse/COUCHDB-1194
Maybe removed once couch server upgrades.
Steve please review and add to next tag.