Fix back-button not working after cancelled navigation

Added the 'replace' option to the navigation that happens back to the
original route, after some other navigation fails. This prevents the
failed location to be added to the browser history, causing the
back-button to retry the failed navigation in an endless loop.