South Carolina lawmaker accused of beating his wife resigns