Novartis beats Q2 profit estimates as cancer drugs offset patent losses