Security software company Avast has announced that it is buying rival AVG Technologies for $1.3 billion in an all-cash deal.…