First-principles calculations and thermodynamic modeling of the S-Se system and implications for chalcogenide alloys