RepositoryService: Check for Total-Count header, as it is not sent when forceTotalCount is disabled. Fixes #36051