Logging out with ckan on non-root URL redirects to the wrong URL.

When running ckan on a non-root URL, clicking on logout ends up in a redirect which does not take the api_url into consideration.