Real Madrid beat Real Sociedad 1-0 in their Copa del Rey semifinal first-leg tie, but match marred by racist abuse.