On the Robustness of Transformers against Context Hijacking for Linear Classification