add retry semantics to with_lock

There are a few changes we needed when using this on a project:

1. You can specify a time to sleep between retrying lock acquisition (instead of just the default of time left on lock)
2. You can retry more than once
3. Always reload the document after acquiring the lock (even if you didn't have to sleep). This deals with instances of non-cooperative users on a document.
4. Expose ability to suppress reloading (Not sure why anyone would ever want to do this, but enjoy!)

Credit also goes to @yanowitz and @nchainani