Cofiniteness with respect to ideals of dimension one