iMAD: Intelligent Multi-Agent Debate for Efficient and Accurate LLM Inference