Fix bug that causes _treeList to only return last directory entry

One effect of this was that repository.deletePaths(...) would only delete directories with at most one file in them, two or more files caused an exception.