Fix segfault on exit in case Route Manager was open during the session