calc77i.c: clean up finalize() state-dependent machinery