Retry failed operations

Added ability to retry failed operations. The max number of retries is limited.
The total number of retries is counted. The retries are done within the same
operation, so they doesn’t affect the number of operations, but increases
the latency of the operation. The retries can be done with delays between them.