directory: fix ref leak in directory_next_child.