Fixed #23370 -- defer() fails with inherited models

Related ticket: https://code.djangoproject.com/ticket/23370
```* Fixed a crash when using `QuerySet.defer()` with `select_related()` (:ticket:`23370`).```