`RetryAttempt`: Fix the backoff algorithm.

`RetryAttempt` now returns the expected delay in addition to indicating
whether the operation can be retried.

`RetryFunc` now returns the correct number of attempts if the retry
was cancelled.
Allow `MaxJitter` = 0.
Add retry tests.