Added a retry mechanism

Any retryable error is not bubbled up to the application immediately,
but retried every second for up to 10 seconds before throwing an error
Fixed object being disposed before it is passed back to the caller
Merge commit '2e44186840ac705bec710578a1f7b6b93882422c'