Alan Joyce is stepping down sooner than expected as Australia’s biggest airline navigates a public-relations crisis.