Not All Votes Count! Programs as Verifiers Improve Self-Consistency of Language Models for Math Reasoning