Generative AI for Programming Education: Benchmarking ChatGPT, GPT-4, and Human Tutors