Safer cursor saving / restoring for cgc.