tests: fix cleanup after tests in t1509-root-worktree