A characterization of semiprojectivity for commutative C*‐algebras