A characterization of quasi-perfect equilibria