Fix EZP-21906: Search API returns wrong number of total objects with content having multiple locations

https://jira.ez.no/browse/EZP-21906

When running a query with Search API, if one of the returned content objects has multiple locations, `SearchResult->totalCount` is wrong. It's superior to the actual number of results.
Even more, when using `LocationPriority` sort clause, `totalCount` is even greater.

[Script to reproduce](https://gist.github.com/lolautruche/27db1c1d2999c0e4554f)