Fix stack overflow in async.queue

Which happened when too many synchronous tasks were queued.

This should fix #413, although one test still fails