make kp_init_state a little faster

Use memset to init all stack value to nil, instead of
for-loop many times, memset would be more efficient.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>