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.
Yeah, I was thinking about this class modification. It seems that it can cause some problems.
But I didn't undestand what you suggested.

You mean that we can assign like that `self.original_content_type_id = cached_property(_original_content_type_id)` like that? But it won't work. And that is the main problem - that we can't dynamically assign a `property()` to the class object itself.

Another aproach is to assign `_original_content_type_id` function to `self` as a pure method. But it will work only for templates while can break some python code.