Add ability to inspect upcoming sleep in `stop` funcs, and add `stop_before_delay` (#423)

* Add upcoming_sleep to retry_state, and add stop_before_delay stop.

* Add unit test to cover stop_before_delay.

* Changelog.

* Update docs for stop_before_delay.

* More docs for the two stop_x_delay functions.

* Add test to ensure it acts the same as stop_after_delay when upcoming sleep is 0.

* Linter fixups.

---------

Co-authored-by: Julien Danjou <julien@danjou.info>
5 files changed