Fix the only_latest flag in the store list methods

The previous behaviour was incorrect and the tests failed to give a
scenario that tested it well. Simply put, before the max version was
selected globally and this resulted with files only being returned if
they matched the highest version across all files.

Change-Id: Ifa8d7bc95546a638505f64cab3b7d8e294753fb0
Merge "Fix the only_latest flag in the store list methods"