Fix  ST_ShortestPath exception

Fix an exception if the geometry column is not the first column in the
table passed to ST_ShortestPath.