/results/latest: use a single query with subquery join
... instead of issuing a separate query for every possible matching test
case, of which there could be a very large number.
This improves the performance of the /results/latest endpoint, which is
currently domainated by roundtrip time to the database for all the
queries.
Fixes #84.