Warner Bros. Discovery reported a larger-than-forecast loss in the second quarter, but the loss was narrower than a year