A lock-stitch is very good, but not as good as a hand-stitch (what Rancourt et. al use for their moc-toes). A lock-stitch will stay secure usually, especially on a seam that doesn't have much pull. But, it can run if pulled, since each thread is only being held in place by the friction of the other thread. Hence why the glue is so important, if there were no glue, there would constantly be a pull on the threads, and it would slowly run.
A hand-stitch is much better (but very rare for a sole). It's what Rancourt et al use for their moc-toes (and for the Chromepack soles). It has two threads alternating sides, and if done properly, a half-knot tied on each hole (this feature is hidden inside of the hole, but watch videos of Rancourt stitching their shoes, and you'll see that on every stitch, the guy will do a little movement where he wraps the needle around the other thread. So, if a thread breaks, there's a lot of friction holding the thread in place, not to mention the half-knot.
Very rarely seen on shoes (but I've seen it!) is a chain-stitch or double chain-stitched welt. I've only seen it once, on a 50 year old pair of Wolverine 1000 Mile boots, in their company store in NYC. The welt was actually *two* double chain stitches (an interesting sight) running around the welt. Chain stitches suck for reinforcement, require very specialized machines, and a lot of skill to stitch. If the thread breaks, or the sewer misses a single stitch, they'll just run right out. But they do look awesome.