Fixed potential problem with IndexError in QuerySet.first()

The current implementation may suppress internal IndexError exceptions.

Please see ticket 23555 for more details. https://code.djangoproject.com/ticket/23555#ticket
@timgraham  `grep -rI get_earliest_or_lates tests/` returns nothing for me. :( Where do you find this?