Runaway stars as progenitors of supernovae and gamma-ray bursts