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

Related ticket: https://code.djangoproject.com/ticket/23370