[SPARK-31713][INFRA] Make test-dependencies.sh detect version string correctly
[SPARK-31713][INFRA] Make test-dependencies.sh detect version string correctly

### What changes were proposed in this pull request?

This PR makes `test-dependencies.sh` detect the version string correctly by ignoring all the other lines.

### Why are the changes needed?

Currently, all SBT jobs are broken like the following.
- https://amplab.cs.berkeley.edu/jenkins/view/Spark%20QA%20Test%20(Dashboard)/job/spark-branch-3.0-test-sbt-hadoop-3.2-hive-2.3/476/console
```
[error] running /home/jenkins/workspace/spark-branch-3.0-test-sbt-hadoop-3.2-hive-2.3/dev/test-dependencies.sh ; received return code 1
Build step 'Execute shell' marked build as failure
```

The reason is that the script detects the old version like `Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT` when `build/mvn` did fallback.

Specifically, in the script, `OLD_VERSION` became `Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT` instead of `3.1.0-SNAPSHOT` if build/mvn did fallback. Then, `pom.xml` file is corrupted like the following at the end and the exit code become `1` instead of `0`. It causes Jenkins jobs fails
```
-    <version>3.1.0-SNAPSHOT</version>
+    <version>Falling</version>
```

**NO FALLBACK**
```
$ build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
3.1.0-SNAPSHOT
```

**FALLBACK**
```
$ build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec
Falling back to archive.apache.org to download Maven
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
3.1.0-SNAPSHOT
```

**In the script**
```
$ echo $(build/mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec)
Using `mvn` from path: /Users/dongjoon/APACHE/spark-merge/build/apache-maven-3.6.3/bin/mvn
Falling back to archive.apache.org to download Maven 3.1.0-SNAPSHOT
```

This PR will prevent irrelevant logs like `Falling back to archive.apache.org to download Maven`.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the PR Builder.

Closes #28532 from dongjoon-hyun/SPARK-31713.

Authored-by: Dongjoon Hyun <6ff48b33cbb828151035af58a92f18a39f1d1036@apache.org>
Signed-off-by: Dongjoon Hyun <6ff48b33cbb828151035af58a92f18a39f1d1036@apache.org>

taroplus/spark,BryanCutler/spark,wangyum/spark,wangyum/spark,dongjoon-hyun/spark,WeichenXu123/spark,shuangshuangwang/spark,rednaxelafx/apache-spark,dbtsai/spark,hvanhovell/spark,JoshRosen/spark,srowen/spark,maropu/spark,milliman/spark,witgo/spark,shuangshuangwang/spark,wangyum/spark,nchammas/spark,witgo/spark,shuangshuangwang/spark,maropu/spark,holdenk/spark,srowen/spark,ptkool/spark,ptkool/spark,taroplus/spark,gengliangwang/spark,zero323/spark,shaneknapp/spark,zero323/spark,hvanhovell/spark,witgo/spark,HyukjinKwon/spark,shaneknapp/spark,jiangxb1987/spark,ptkool/spark,holdenk/spark,apache/spark,apache/spark,jiangxb1987/spark,jiangxb1987/spark,nchammas/spark,rednaxelafx/apache-spark,srowen/spark,HyukjinKwon/spark,nchammas/spark,holdenk/spark,ueshin/apache-spark,maropu/spark,milliman/spark,zero323/spark,mahak/spark,BryanCutler/spark,ueshin/apache-spark,JoshRosen/spark,nchammas/spark,taroplus/spark,ptkool/spark,milliman/spark,HyukjinKwon/spark,WeichenXu123/spark,dongjoon-hyun/spark,vinodkc/spark,dongjoon-hyun/spark,milliman/spark,mahak/spark,spark-test/spark,wangmiao1981/spark,xuanyuanking/spark,ptkool/spark,xuanyuanking/spark,maropu/spark,spark-test/spark,cloud-fan/spark,xuanyuanking/spark,apache/spark,zero323/spark,cloud-fan/spark,witgo/spark,zzcclp/spark,BryanCutler/spark,BryanCutler/spark,wangmiao1981/spark,jiangxb1987/spark,rednaxelafx/apache-spark,chuckchen/spark,vinodkc/spark,maropu/spark,zero323/spark,rednaxelafx/apache-spark,hvanhovell/spark,witgo/spark,mahak/spark,wangmiao1981/spark,wangmiao1981/spark,JoshRosen/spark,xuanyuanking/spark,zzcclp/spark,gengliangwang/spark,srowen/spark,shuangshuangwang/spark,shuangshuangwang/spark,mahak/spark,WeichenXu123/spark,WeichenXu123/spark,apache/spark,maropu/spark,rednaxelafx/apache-spark,vinodkc/spark,holdenk/spark,zzcclp/spark,spark-test/spark,cloud-fan/spark,dbtsai/spark,vinodkc/spark,dbtsai/spark,shaneknapp/spark,taroplus/spark,BryanCutler/spark,zzcclp/spark,mahak/spark,nchammas/spark,ConeyLiu/spark,wangmiao1981/spark,xuanyuanking/spark,srowen/spark,nchammas/spark,ConeyLiu/spark,holdenk/spark,zero323/spark,srowen/spark,spark-test/spark,hvanhovell/spark,chuckchen/spark,JoshRosen/spark,cloud-fan/spark,dbtsai/spark,zzcclp/spark,shaneknapp/spark,ConeyLiu/spark,spark-test/spark,dbtsai/spark,taroplus/spark,milliman/spark,ueshin/apache-spark,HyukjinKwon/spark,wzhfy/spark,gengliangwang/spark,hvanhovell/spark,gengliangwang/spark,wangyum/spark,xuanyuanking/spark,holdenk/spark,gengliangwang/spark,JoshRosen/spark,ueshin/apache-spark,milliman/spark,WeichenXu123/spark,hvanhovell/spark,chuckchen/spark,wzhfy/spark,dongjoon-hyun/spark,wzhfy/spark,spark-test/spark,wangyum/spark,BryanCutler/spark,ConeyLiu/spark,maropu/spark,shaneknapp/spark,chuckchen/spark,mahak/spark,shuangshuangwang/spark,taroplus/spark,JoshRosen/spark,witgo/spark,cloud-fan/spark,ptkool/spark,zzcclp/spark,wangmiao1981/spark,wangmiao1981/spark,ptkool/spark,shaneknapp/spark,BryanCutler/spark,chuckchen/spark,dongjoon-hyun/spark,rednaxelafx/apache-spark,witgo/spark,mahak/spark,zero323/spark,wzhfy/spark,gengliangwang/spark,dbtsai/spark,holdenk/spark,taroplus/spark,apache/spark,nchammas/spark,ConeyLiu/spark,vinodkc/spark,wzhfy/spark,jiangxb1987/spark,srowen/spark,chuckchen/spark,gengliangwang/spark,milliman/spark,wangyum/spark,dongjoon-hyun/spark,HyukjinKwon/spark,jiangxb1987/spark,vinodkc/spark,apache/spark,ConeyLiu/spark,vinodkc/spark,JoshRosen/spark,HyukjinKwon/spark,WeichenXu123/spark,shaneknapp/spark,rednaxelafx/apache-spark,spark-test/spark,apache/spark,wzhfy/spark,cloud-fan/spark,ueshin/apache-spark,zzcclp/spark,HyukjinKwon/spark,ConeyLiu/spark,chuckchen/spark,xuanyuanking/spark,wangyum/spark,shuangshuangwang/spark,ueshin/apache-spark,ueshin/apache-spark,hvanhovell/spark,dongjoon-hyun/spark,dbtsai/spark,WeichenXu123/spark,jiangxb1987/spark,cloud-fan/spark,wzhfy/spark