Fixed #23444 -- Prevented unnecessary ContentType object creation when using inlines

ContentType object is mistakenly created for `through` model of M2M relation when it is used in inline.
That is exactly what I meant in my last comment.
The only thing is it might be useful to add this code: `raise AttributeError` as a last line of `original_content_type_id` method. It would handle the case when someone could try-catch this attr call.
Also what do you think about moving warning to the first line? It looks logical for me since this method is fully deprecated.

```python
@cached_property
def original_content_type_id(self):
    warnings.warn("Use absolute_url attr instead.", RemovedInDjango20Warning)
    if self.original is not None:
        # Since this module gets imported in the application's root package,
        # it cannot import models from other applications at the module level.
        from django.contrib.contenttypes.models import ContentType
        return ContentType.objects.get_for_model(self.original).pk
    raise AttributeError
```

BTW in ticket-23444 there is a suggetion to move a fix to `get_for_model` method and don't change anything here.