move ktap_free(ks, ks) from ktap_exitthread to ktap_exit

ktap_exitthread don't have to free ktap_State now, since thread is
based on percpu
fix memory leak on cfunction_tbl