Fix a bug with inline dereferencing and "JSON Pointer" refs

For instance, this schema:

----
{ "$ref": "#/a/b", "foo": { "id": "#/a", "b": { "type": "integer" } } }
----

would normally lead to content at pointer "/foo/b".

Unfortunately this didn't work: when asked to match a JSON Reference in this
tree, and that JSON Reference's fragment part was a JSON Pointer, the first test
would be against the loading URI of the schema. And this would always be true
even if any subsequent "id"s would define another, more appropriate subpath.

/me kicks "id" harder than ever.

Anyway. The solution here is to make the test against the loading ref as the
_last_ test instead of the first. This way we are sure that a child pointer (at
least) will take precedence.

But I guess this is not the end of it yet. I already envision a test case where
even the current code fails to do what is needed... Meh. "id" is a mess.

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