[json serialize] fix refcounting problem