Add support for retries in bulk

Upstreamed with https://github.com/ruflin/Elastica/pull/624

Change-Id: I7e82ce6b64e8599ae004a6d41596e2138079f724
Merge "Add support for retries in bulk"