Optical second-harmonic generation in ferroelectric liquid crystals with a twist defect