PARIS (Reuters) - Aerospace and defense technology group Thales has agreed to buy chipmaker Gemalto in an all-cash offer, promising to create a "world leader in digital security" and trumping an earlier takeover bid by tech firm Atos.