Self-training Avoids Using Spurious Features Under Domain Shift