exponential backoff

This small changes adds exponential backoff to the _flush_writes method. It is hard-coded to fail after 10 retries (about 30 minutes) - this should probably be refactored into an optional input parameter.

This is also my first pull request, so I apologize if there's something wrong here (I don't know how to unstage the LICENSE/README)

If merging this is a hassle I can just send you the code. Cheers.