Analytic configuration interaction (CI) gradient techniques for potential energy hypersurfaces. A method for open-shell molecular wave functions