The Stability of a Dislocation Threading a Strained Layer on a Substrate