terminate ctx from nn_global_term. matches init call for ctx in nn_global_init