router: fix segfault when trying to shove a line that forms a closed loop.