pithos: Refactor latest_version_list query