An extension of the Poincaré-Fermi theorem on the nonexistence of invariant manifolds in nearly integrable Hamiltonian systems