Motion of a gyroscope on a closed timelike curve