[SPARK-4504][Examples] fix run-example failure if multiple example jars present

Fix run-examples script error during multiple jars.
Modified to support failing fast similar to assembly.jar

Author: Venkata Ramana G <ramana.gollamudi@huawei.com>
If we just want to show the user a list of the found jars, why not just call `ls` directly instead of capturing and replaying its output? That would be safer and simpler, no?