storage*: type origin_visit_get_latest endpoint result
The endpoint returns an optional OriginVisit object instead of a dict:
def origin_visit_get_latest(...) -> Optional[OriginVisit]
It also fixes the in-memory storage implementation which filtered data too early. It only filtered on the latest origin visit status associated to the origin visit. So depending on filters, this could have been wrong. It was not much of a problem as there is no longer any direct clients of this api (they are using [1] now).
This will allow in a subsequent diff to simplify the function [1] (and reintroduce the use of this api, albeit indirectly).
- [1] swh.storage.algos.origin.origin_get_latest_origin_visit_status function.
Related to T645
Test Plan
tox
Migrated from D3620 (view on Phabricator)