Time needlessly spent in hospital by patients who are medically fit to leave has been cut by nearly a third across Lancashire and South Cumbria in the last two years.