Origin of precursors to teleseismic S waves