(CFACT 92) convert kstat to scoped resource

Before this patch, the kstat_ctl pointer was managed by hand. This patch introduces
the scoped kstat resource which manages the pointer's scope automatically.