retry_times implemented

This function helps to have a retry loop with fixed number of times instead of timing out using timeout_deferred. This way the work being done is never cancelled when in progress