implement free_dfa()