Scaffolding Metacognition in Programming Education: Understanding Student-AI Interactions and Design Implications