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
Maybe I was not attentive enough, but I have not found any test for the `first()` and `last()` methods and for `IndexError` exception raised by the `__getitem__()` method. Also 'test_success" works as an opposite example for the failing tests, so that we can see the difference and can be sure all is working fine both in successful and failing scenario.