If index is stale we may miss timeouts, fixes #2133

Simplify querying for timeouts, and introduce cleaning-up abilities to guarantee we don't skip any timeouts

Further avoid duplicates by better cleanup logic

Adding failing tests demonstrating skipped timeouts
@andreasohlund wanted to have this configurable, and it's also being set from tests to ensure cleanup isn't kicked in automatically so we can take control of it. It isn't a change to the interface and only something that is being used internally , so I think it's good