Redirect user if logging out from recommended (bug 1110326)

This uses `history.replaceState`, so `/recommended` never shows up in the browser history, and it won't force the full page to reload.