api: clean queues after preempting handlers