I think you need to look up what a deux-ex-machina actually is.
"The term has evolved to mean a plot device whereby a seemingly unsolvable problem is suddenly and abruptly resolved by the inspired and unexpected intervention of some new event, character, ability or object."
Given that we saw the Teselecta five whole episodes before TWORS, at which point it was obviously a potential get out (as were the other ones Moffat seeded through the series: the Flesh, the two Amys) it doesn't really count
"The term has evolved to mean a plot device whereby a seemingly unsolvable problem is suddenly and abruptly resolved by the inspired and unexpected intervention of some new event, character, ability or object."
Given that we saw the Teselecta five whole episodes before TWORS, at which point it was obviously a potential get out (as were the other ones Moffat seeded through the series: the Flesh, the two Amys) it doesn't really count