On the metric regularity of affine optimal control problems