retry_on_failure off-by-one error

According to the documentation `:retry_on_failure` specifies the number of times a request is **retried** before failing.

The current implementation uses this as the max number of tries (instead of retries). Those 2 patches deal with the issue. I chose to modify function and constant names to make clearer how  they are used.