detect and accommodate reverse condition for loader strategy
Fixed issue where chained :func:`_orm.joinedload` options would not be
applied correctly when the final relationship in the chain is declared on a
base mapper and accessed through a subclass mapper in a
:func:`_orm.with_polymorphic` query. The path registry now correctly
computes the natural path when a property declared on a base class is
accessed through a path containing a subclass mapper, ensuring the loader
option can be located during query compilation.
Fixes: #13193
Change-Id: I9ec83a0f184caed2bf6dd087b20c3538d6c23597
(cherry picked from commit
5f7e29fb4657367d8b02bd5d56ad28807b9df691)