Even before Augustine, St. Ambrose of Milan and St. Jerome used this verse in support of the dogma of the Perpetual virginity of Mary. Probably St. Augustine learned from his teacher St. Ambrose of Milan.
Some quite emphatically understand this closed gate through which only the Lord God of Israel passes … as the Virgin Mary, who remains a Virgin before and after childbirth. In fact, she remains always a Virgin, in the moment in which the Angel speaks with her and when the Son of God is born. -St. Jerome (Commentarium in Evangelium Lucae, PL 25, 430.)
Only Christ opened the closed doors of the virginal womb, which continued to remain closed, however. This is the closed eastern gate, through which only the high priest may enter and exit and which nevertheless is always closed. -St. Jerome (Dialogus contra Pelagianos 2, 4)
“Who is this gate (Ezekiel 44:1-4), if not Mary? Is it not closed because she is a virgin? Mary is the gate through which Christ entered this world, when He was brought forth in the virginal birth and the manner of His birth did not break the seals of virginity.” -St. Ambrose (The Consecration of a Virgin and the Perpetual Virginity of Mary , 8:52)
"She is closed because she is a virgin; she is a gate, because Christ has entered through her......This gate faces east, because she has given birth to him who rises, the sun of justice.....Mary is the good gate that was closed and was not opened. Christ passed through it, but did not open it." -St. Ambrose (De Institutione Virginis, 8, 57. PL 16, 334)
But these people may not be the first to say this, because all of them are of same time period and people after them too use this same verse for this purpose and do not attribute it to them. This interpretation probably existed for more than a century before and is put in writing by these men.
The verse says that the door is already shut. And the only reason for it being shut is because the Lord has entered by it; And because of this reason It shall remain shut. Mary is ever virgin. The reason why Mary is virgin is because Jesus was born thru her. And because of that reason she will remain a virgin for ever (i.e., her womb will be shut, no one else will enter or exit it).
//It seems to me that the context of this passage is about the temple that Ezekiel is to have built//
If you look closely, almost every messianic prophecy is a context to something else. Take for example the prophesy The virgin will conceive and give birth to a son, and will call him Immanuel. (Is 7:14) In its immediate context this is a sign to king Ahaz of Judah, promising the king that God will destroy his enemies even before that child grows up(Is 7:16). But Matthew holds that this as fulfilled in Jesus (Mat 1:23).
Such difference of context was the main point of contention between Jews and Christians from early on. Even Jesus had to explain this to his disciples (Luke 24:27).