Analytic energy second derivatives for two-configuration self-consistent-field wave functions. Application to twisted ethylene and to the trimethylene diradical