InlineSchemaTree: make ref lookup work in all cases

We had to separate non pointer terminated references from pointer terminated
references. This simplifies the job quite a lot.

Signed-off-by: Francis Galiegue <fgaliegue@gmail.com>