My theory: He wasn't controlling Erik, but was just using him like a window to see our world.
The brief scene at the end of Thor never indicated that Loki was actually exerting some kind of control over Erik, only that he was seeing through his eyes. This is speculation, but this "Erik-Vision" is probably what allowed Loki to know of the Tesseract and its location.
In The Avengers, it was never explained how Loki knew the location of the Tesseract. The only thing close was the following exchange between he and Thor later in the film:
THOR: You think yourself above them.
LOKI: Well, yes.
THOR: Then you miss the truth of ruling, brother. A throne would suit
Angrily, Loki shoves his brother to the side. He walks back up to the
ledge. Turns around.
LOKI: I've seen worlds you've never even known about! I have grown,
Odinson, in my exile! I have seen the true power of the Tesseract, and
when I wield it...
THOR: Who showed you this power? Who controls the would-be-king?
The scene implies that Loki was shown the true power of the Tesseract by his benefactors, who turn out to be
Thanos & the Chitauri who serve him.
However, it's quite possible that Loki - through Erik's eyes - was the one to determine that the Tesseract was on Earth in the SHIELD facility. Once revealing this, it would naturally become a target for his benefactors, thus leading to the bargain they struck with Loki.
Unfortunately, the stinger scene is not included in the script, so we are left to speculate.