Functional relations and analytic Bethe ansatz for twisted quantum affine algebras