don't dereference at the end of the workdir iterator

Propagate the end of the workdir iterator to the caller.

/cc @arrbee