In the initial phrase, if I just saw the melody, I would have been sure that, in the third full measure, the melody switches to (V). Yet the accompaniment stays firmly in (i) and it sounds great. Does this technique have a name and why does it sound so good? Are there any other well-known pieces that do that?
Yes, it could go to E7 in bar 3. But it stays on Am instead. And all we can really say about that is 'composer's choice'. Both are fine. And a few other moves would have been fine too.
This parsimonious use of harmonies is characteristic of early Classical music. The longer you stay on one chord, the more dramatic when you eventually DO use another one - even one as seemingly obvious as a V. Simple, and clever.
In general, the stubborn keeping of one (often, but not always, bass-) note/harmony against melodies that don't really fit on it is called pedal point.
But I definitely would hesitate to call this a pedal. What's actually going on is that Mozart is (arguably, rather bluntly) appropriating the stereotypical “eastern” double harmonic minor scale, which has a characteristic ♯ⅳ degree whilst clearly being in minor (definitely not Lydian). In fact, notice how the last beat in bar two literally clashes C and E with D♯, which is enharmonic to a minor and major third simultaneously:
X:1 L:1/16 M:2/4 K:C %%score T1 B V:T1 clef=treble V:B clef=bass % 1 [V:T1] z4 (fe"!"^de | .b2) [V:B] (A,2.[C2E2]) .[C2E2].[C2E2] | A,2
That's something that doesn't really happen in classical music (ever?).
What happens a lot in classical music though is that sharpened degrees are used as leading notes into another tonic. Specifically here, Mozart is no doubt playing with the listener's expectation that the ♯ⅳ note should lead to the dominant, like
X:1 L:1/16 M:2/4 K:C %%score T1 B V:T1 clef=treble V:B clef=bass % 1 [V:T1] z4 (fe^d2) | e4 [V:B] (A,2.[C2E2]) .[C2E2](B,A,) | (^G,2.[B,2D2]) .[B,2D2].[B,2D2]
and as you noticed the melody seems to confirm that by going into B·A·G♯, but not really – actually the whole bar 3 acts more like a mere turn ornament on the note A, as it were
X:1 L:1/16 M:2/4 K:C %%score T1 B V:T1 clef=treble V:B clef=bass % 1 [V:T1] z4 (fe^f^g) | !turn!a4 !turn!a4 [V:B] (A,2.[C2E2]) .[C2E2].[C2E2] | (A,2.[C2E2]) .[C2E2].[C2E2]
The melody of the first four bars is firmly based on A minor. Each of the sixteenth-note turns starts one note above the main note, and the main notes form an A minor triad. The only slightly unusual note is the D sharp, but that in combination with the F gives the piece the "Turkish" flavor.