[SPARK-29932][R][TESTS] lint-r should do non-zero exit in case of errors
[SPARK-29932][R][TESTS] lint-r should do non-zero exit in case of errors

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

This PR aims to make `lint-r` exits with non-zero in case of errors. Please note that `lint-r` works correctly when everything are installed correctly.

### Why are the changes needed?

There are two cases which hide errors from Jenkins/AppVeyor/GitHubAction.
1. `lint-r` exits with zero if there is no R installation.
```bash
$ dev/lint-r
dev/lint-r: line 25: type: Rscript: not found
ERROR: You should install R
$ echo $?
0
```

2. `lint-r` exits with zero if we didn't do `R/install-dev.sh`.
```bash
$ dev/lint-r
Error: You should install SparkR in a local directory with `R/install-dev.sh`.
In addition: Warning message:
In library(SparkR, lib.loc = LOCAL_LIB_LOC, logical.return = TRUE) :
  no library trees found in 'lib.loc'
Execution halted
lintr checks passed.        // <=== Please note here
$ echo $?
0
```

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

No.

### How was this patch tested?

Manually check the above two cases.

Closes #26561 from dongjoon-hyun/SPARK-29932.

Authored-by: Dongjoon Hyun <9b02cb7e37158797a8e22c559f7c5f5ecd28ea57@apple.com>
Signed-off-by: Dongjoon Hyun <9b02cb7e37158797a8e22c559f7c5f5ecd28ea57@apple.com>

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