Near-optimal tensor methods for minimizing the gradient norm of convex functions and accelerated primal-dual tensor methods