lib/repo: Fix loading commitstate with parent repos
This makes the code nicer too. Properly unit testing this though really wants
like a whole set of stuff around parent repos...but we do have coverage of the
non-parent path in the current pull tests.
Closes: https://github.com/ostreedev/ostree/issues/1306
Closes: #1308
Approved by: alexlarsson
Origin: upstream, 2017.13, commit:
90ebd48f6aaf45c47b48c44354359f973dcf22a8
Gbp-Pq: Topic 2017.13
Gbp-Pq: Name lib-repo-Fix-loading-commitstate-with-parent-repos.patch