First-principles calculations of SO2 sensing with Si nanowires