MalAlgoQA: A Pedagogical Approach for Evaluating Counterfactual Reasoning Abilities