The nation’s second-biggest private hospital operator, Healthscope, and health insurer Bupa have averted a funding crisis with a new deal that will spare millions of patients from massive out-of-pocket costs.