database: Ignore order and limit in RepoStore.Count
Created by: tsenart
This PR brings back #19303 after it's been reverted and fixes the issue that caused the revert, which was that the Count method of the RepoStore wasn't ignoring order and limit options as it should have been (since those don't make sense in counting).