tests: checkout::tree: extract check for status entrycount There are multiple locations where we have the same code to check whether the count of status list entries of a repository matches an expected number. Extract that into a common function.