On the periodicity of geodesic continued fractions