[tools/parallel_function] bugfix: return after releasing workers, not before