Fix url helpers on mountable engines

Original pull request: https://github.com/josevalim/inherited_resources/pull/186 by @marcelloma

Changed to trust on a public API instead a obscure method (**_railtie**) and verifies if the engine has an isolated namespace.