Almost 380,000 patients waiting more than a year for treatment, highlighting scale of challenge facing new PM