Theory of surface second-harmonic generation for semiconductors including effects of nonlocal operators