Fix the init_js_extensions call when not matched by a resolver.

It's possible for our base template to be invoked without having a URL
resolver match. For example, certain error pages.

We now skip pulling out the URL name and initializing the extensions if
we don't have a URL resolver match.