commit-graph: close_commit_graph before shallow walk