Any solution has to be based on sustainable equilibrium between raw power. Therefore, the US should pull out, let them fight each other to a stand still from an audience position of Kurdistan bases - with the US, perhaps, supplying the weaker side with weapons. Only when the fighting sides have made a ceasefire based on de facto relative strengths should the west/UN reintervene.
It won't be a slaughter to the end. Everything stabilises at some level of mutual satisfaction, where the weaker pays some price of submission for his continued survival - if that means a severely diminished status for the Sunni muslims so be it.