rationalise timer maintenance
- introduce a couple of helper functions and use them wherever we can
- pay attention to the result of timer cancellation, to prevent
  duplicate timer creation
- stop all timers when a queue terminates. More out of politeness than
  necessity.
test
filter out pending acks when folding over delta
some more reader connection state abstraction
and a slightly more logical (and efficient) handle_frame clause order
...and do the same thing here.
Merge bug25393
remove superfluous condition
cosmetic
Prevent explosion if someone passes a list.
Merge bug25401
stable to default
merge bug25400 into default
merge default into bug23749