MDL-42989 JavaScript: Do not attempt to expand navigation when opening link

When clicking on a link which is also expandable, we should not attempt to
expand it.
MDL-42989 JavaScript: Check result of navigation IO requests before reporting errors

When making a request which fails, we need to ensure that the AJAX query
was not aborted before displaying the error.

This ensures that if the navigation tree is being requested at the same
time as a page load is being processed, the abortion of the AJAX request is
not displayed before the page reloads.