Use the mask to only enqueue tasks that we want everywhere and not just in scheduler_start()
That fixes bug #59 (closed) and is compatible with the new version of scheduler_done() that is in the parallel_sort branch.
I have also made scheduler_unlock() closer to scheduler_done().