Add get_failing_from_run db api method

This commit adds a new db api method to return a list of test_run
objects that failed for a given run_id. This is needed for adding a
subunit2sql based repository in testrepository.

Change-Id: Ib4a283fc3abeae1ecfc74995c2ad85564b06671a