It's actually two independent idioms. "Ta-ra" is how northerners pronounce "Ta-ta" meaning goodbye, which is used all over England; the Oxford English Dic. says this is "a nursery version of 'goodbye' used playfully by adults" and gives the first sighting of it in 1837.
. Source