Retry errors writing to Elasticsearch

Stud::Buffer's flush invocation automatically retries (forever) any
failures to flush.

Supersedes #1180
Merge pull request #1182 from jordansissel/retry-on-failure

Retry errors writing to Elasticsearch