Analytic energy third derivatives for open-shell self-consistent-field wavefunctions