refactor ktap_cdata struct

1. rename st to rec so it can be shared among struct and union
2. move is_allocated outside of struct p, it's now a member of ktap_cdata

also added more checking on freeing cdata_ptr

Signed-off-by: Qingping Hou <qingping.hou@gmail.com>