AstraZeneca beats profit forecasts, helped by external deals