Expired timer cancellation is broken since timer_set assumes that a
timer that is being canceled is not expired yet. This patch fixes the
problem by moving expired timers management outside timer_set and
letting the code that uses it to managed cancellation of expired timers.
In memcached it can never happen, in core each queued timer gets expired
flag that tells if timer is queued in a timer set or in expired timer
list.
It allows for simpler client code because the client can assume that
when cancel() returns the callback will not run and thus there's no
need to handle the race between timer teardown and execution of the
callback.