yea, iirc, he had a lil bit of control so he added the failsafe to it without Loki knowing.
Maybe Loki did have him put in a fail safe just in case things turned on him. It was clear (at least to me) Loki wasn't doing this attack completely of his own free will. The Chitauri clearly had some control, over him. I think he was playing along until with the Chitauri until he could find away to turn the tables. The mountain talk between him and Thor and later Coulson's line that Loki "lacks conviction" adds to that. "The mortals think we are invincible" speech before Thor drops him, hints that Loki has run into some badasses (Thanos). He has learned that Thor and himself can be killed by others.
I kinda agree with earlier posters idea that this is part of a long term Loki plan- known that Thanos/the Chitauri real threat, he may be trying to manipulate both sides- "helping" the Chitauri while bring together warriors outside of Asgard to fight back. (Kinda like how Loki played the Frost Giants in Thor). If the Avengers had failed, Loki likely would have used the fail safe himself to wipe out as many Chitauri as possible before sneaking back into Asguard himself to prepare a second line of defense.
Being captured at the end works to his benefit too- being taken as prisoner to Asgard, Loki is safe temporally due to the Bitfrost being down. He can plot on his own or since fans love Hiddleson's Loki, he could do a temporary face turn for Avengers 2. Remember, Loki not just about gaining power- deep down he just wants to be recognized as being worthy to leader in his father's eyes. Given Asguard's warrior culture, Loki interpreting that as taken down threats to Asguard.