Make sure retry won't crash when either delay or max_delay are misconfigured
When delay or max_delay are less than 1, the Retry middleware currently crashes with
the following error:
- (FunctionClauseError) no function clause matching in :rand.uniform_s/2 (stdlib 3.13) rand.erl:326: :rand.uniform_s/2 (stdlib 3.13) rand.erl:299: :rand.uniform/1 (tesla 1.3.3) lib/tesla/middleware/retry.ex:106: Tesla.Middleware.Retry.backoff/3 (tesla 1.3.3) lib/tesla/middleware/retry.ex:94: Tesla.Middleware.Retry.retry/3
It happens because :rand.uniform/1 requires a positive integer:
https://erlang.org/doc/man/rand.html#uniform-1
This change adjusts max_delay to 1 when it isn't positive and also adjusts
delay to make sure it is positive and smaller than max_delay.