Second solution for IndexError problem in QuerySet

This is a fix for problem described in ticket #23555 https://code.djangoproject.com/ticket/23555

I've sent a pull request with a fix already https://github.com/django/django/pull/3274
But if somebody thinks the code becomes too complicated and prefers to use try/catch despite the problem then I propose this solution with special exception class. Now you can use this safely anywhere:
```
try:
    return qs[0]
except QuerySetIndexError:
    return None
```