gensec: split GENSEC into mechanism-dependent and runtime functions