Safe and Efficient In-Context Learning via Risk Control