Optimisation: eliminate unnecessary computation

Don't run test_semi_infinite backwards if we find a periodic orbit going
forwards