threads: add support for multiple worker handoff queues