Learning to predict and control harmful events: chronic pain and conditioning