Resolve the given schema path in order to obtain a subschema.

Algorithm derived from @jsonforms/core (MIT). Cycle guard follows JSON Forms 3.7.