queue: Make join not wait if there are no unfinished tasks

This fixes GitHub issue #54