This practice seems to be (at least) as old as the Gemara, as the Gemara states in Brachos 27b:
'R. Yirmiah b. Abba is different, because he was a
disciple-colleague. [This can be proven by the fact that] R. Jeremiah
b. Abba said to Rav: Have you made havdalah? He replied: Yes, I
have; and he did not say to him, has the master made havdalah'
In other words, the Gemara proves that R. Yirmiyah was a talmid-chaver, or disciple-colleage, of Rav, because a student/disciple would have addressed his teacher in the third person. There are other instances in the Gemara as well where students referred to their teachers as 'mar', in third person.
It's worth pointing out that the early books of halakha (as in, the Rif, Rambam, Rosh, Tur, Shulchan Aruch) do not mention this at all, and this might be merely the proper practice but not strictly obligated. Taz (Y.D. 242:14), however, does quote this as the halacha. His father in law, the Bach (Y.D. 242:6) seems to believe that while such a practice is appropriate, it is not an absolute requirement, and therefore if one is having an extended conversation with one's teacher, the second person may be used after the first time the teacher is addressed.
In addition, as noted in the comments, many languages, including German (and to some extent, Spanish, Portuguese, and Swedish) have an 'honorific' grammatical form which makes use of the third person even when the subject is being addressed directly. The Wikipedia article on the subject includes Hebrew as an example.