On the Stability of Structured Prediction