[5.7][Runtime] Fix short-circuiting of shared cache conformance lookups.
We were skipping shared cache queries if the ObjC metadata or descriptor were outside the shared cache, but we need to skip only if they're both outside the shared cache. We also need to check foreign types even if the descriptor is outside the shared cache.
rdar://93931813
(cherry picked from commit f2407bf0a70991bb52df0ddb94fed2f801a1de5a)