I'm a bit unsure of the semantics of `stopAfterNextCallback`. What if, for instance, the other thread is in the middle of executing a callback when `stop(true)` is called here. Then won't it just finish the _currently executing_ callback?

It seems like the semantics are something like:

(a) If there is a callback currently being executed, it will be allowed to finish, and then the timer will stop.
(b) If we are currently waiting in-between callbacks, then we will fully execute a single additional callback and then the timer will stop.

Am I understanding that correctly? Those seem pretty convoluted to me. What about just adding checking `stopped` again after you wake up from sleeping. Then you could have the flag just provide (a) but not (b).