Fix a rare race condition when tracing tf.Variables in tfp.math.minimize inside TF1 graph mode.
Fix a rare race condition when tracing tf.Variables in tfp.math.minimize inside
TF1 graph mode.

PiperOrigin-RevId: 432484975

tensorflow/probability,tensorflow/probability