origin_visit_get_latest: Order by visit id instead of date
This allows both the postgresql and cassandra backends to make efficient queries by using an index (resp. clustering key) instead of scanning all visits of the given origin then sorting by date.
This does not affect the results for the last majority of cases, as ids are always in increasing chronological, unless an origin was re-loaded from an old archive.
This should resolve recurring timeouts on this endpoint (6.4k occurrences in a month)
Migrated from D7339 (view on Phabricator)