[SPARK-17499][SPARKR][FOLLOWUP] Check null first for layers in spark.mlp to avoid warnings in test results
[SPARK-17499][SPARKR][FOLLOWUP] Check null first for layers in spark.mlp to avoid warnings in test results

## What changes were proposed in this pull request?

Some tests in `test_mllib.r` are as below:

```r
expect_error(spark.mlp(df, layers = NULL), "layers must be a integer vector with length > 1.")
expect_error(spark.mlp(df, layers = c()), "layers must be a integer vector with length > 1.")
```

The problem is, `is.na` is internally called via `na.omit` in `spark.mlp` which causes warnings as below:

```
Warnings -----------------------------------------------------------------------
1. spark.mlp (test_mllib.R#400) - is.na() applied to non-(list or vector) of type 'NULL'

2. spark.mlp (test_mllib.R#401) - is.na() applied to non-(list or vector) of type 'NULL'
```

## How was this patch tested?

Manually tested. Also, Jenkins tests and AppVeyor.

Author: hyukjinkwon <gurwls223@gmail.com>

Closes #15232 from HyukjinKwon/remove-warnnings.

bdrillard/spark,metamx/spark,ioana-delaney/spark,sahilTakiar/spark,stanzhai/spark,jlopezmalla/spark,map222/spark,publicRoman/spark,pgandhi999/spark,narahari92/spark,holdenk/spark,brad-kaiser/spark,darionyaphet/spark,ConeyLiu/spark,bravo-zhang/spark,andrewor14/spark,HyukjinKwon/spark,rednaxelafx/apache-spark,wangmiao1981/spark,sureshthalamati/spark,hhbyyh/spark,kissmetrics/spark,WindCanDie/spark,nlalevee/spark,akopich/spark,WindCanDie/spark,JerryLead/spark,zzcclp/spark,LantaoJin/spark,liyichao/spark,WeichenXu123/spark,shaneknapp/spark,spark-test/spark,ibm-research-ireland/sparkoscope,vinodkc/spark,HyukjinKwon/spark,JoshRosen/spark,xflin/spark,yanboliang/spark,LantaoJin/spark,janewangfb/spark,alunarbeach/spark,bdrillard/spark,cin/spark,taroplus/spark,huang1900/spark,SnappyDataInc/spark,panfengfeng/spark,maropu/spark,sureshthalamati/spark,joseph-torres/spark,nlalevee/spark,techaddict/spark,liyichao/spark,bdrillard/spark,witgo/spark,huang1900/spark,rednaxelafx/apache-spark,facaiy/spark,mahak/spark,mike0sv/spark,jiangxb1987/spark,ericvandenbergfb/spark,techaddict/spark,zuotingbing/spark,guoxiaolongzte/spark,sachintyagi22/spark,map222/spark,brad-kaiser/spark,ron8hu/spark,SnappyDataInc/spark,jianran/spark,minixalpha/spark,eyalfa/spark,SnappyDataInc/spark,shaneknapp/spark,bdrillard/spark,mahak/spark,panfengfeng/spark,mdespriee/spark,sachintyagi22/spark,mahak/spark,ptkool/spark,WindCanDie/spark,gengliangwang/spark,bdrillard/spark,nlalevee/spark,xuanyuanking/spark,mike0sv/spark,xuanyuanking/spark,bravo-zhang/spark,bravo-zhang/spark,map222/spark,kevinyu98/spark,xuanyuanking/spark,caneGuy/spark,bdrillard/spark,WindCanDie/spark,milliman/spark,minixalpha/spark,saltstar/spark,shuangshuangwang/spark,publicRoman/spark,WeichenXu123/spark,byakuinss/spark,jianran/spark,ConeyLiu/spark,JoshRosen/spark,Aegeaner/spark,MLnick/spark,jkbradley/spark,chuckchen/spark,ahnqirage/spark,Aegeaner/spark,patrick-nicholson/spark,mzl9039/spark,wangyum/spark,chuckchen/spark,stanzhai/spark,sachintyagi22/spark,adrian-ionescu/apache-spark,icexelloss/spark,kimoonkim/spark,aosagie/spark,andrewor14/spark,akopich/spark,setjet/spark,techaddict/spark,mike0sv/spark,akopich/spark,gengliangwang/spark,wzhfy/spark,kiszk/spark,caneGuy/spark,kevinyu98/spark,wangmiao1981/spark,WeichenXu123/spark,jianran/spark,JoshRosen/spark,facaiy/spark,taroplus/spark,zhouyejoe/spark,JerryLead/spark,dongjoon-hyun/spark,dbtsai/spark,szhem/spark,esi-mineset/spark,byakuinss/spark,zhouyejoe/spark,metamx/spark,ajaysaini725/spark,adrian-ionescu/apache-spark,kissmetrics/spark,lvdongr/spark,andrewor14/spark,BryanCutler/spark,skonto/spark,xflin/spark,mdespriee/spark,minixalpha/spark,icexelloss/spark,saltstar/spark,zhouyejoe/spark,UndeadBaneGitHub/spark,skonto/spark,bOOm-X/spark,shuangshuangwang/spark,spark-test/spark,JoshRosen/spark,esi-mineset/spark,rezasafi/spark,vinodkc/spark,kevinyu98/spark,jrshust/spark,darionyaphet/spark,MLnick/spark,zuotingbing/spark,eyalfa/spark,zzcclp/spark,minixalpha/spark,matthewfranglen/spark,techaddict/spark,UndeadBaneGitHub/spark,publicRoman/spark,jlopezmalla/spark,kiszk/spark,alunarbeach/spark,taroplus/spark,lxsmnv/spark,shaneknapp/spark,highfei2011/spark,shuangshuangwang/spark,jrshust/spark,bravo-zhang/spark,rezasafi/spark,map222/spark,rednaxelafx/apache-spark,ConeyLiu/spark,kimoonkim/spark,ueshin/apache-spark,dhruve/spark,BryanCutler/spark,HyukjinKwon/spark,bravo-zhang/spark,someorz/spark,darionyaphet/spark,kevinyu98/spark,LantaoJin/spark,patrick-nicholson/spark,sahilTakiar/spark,holdenk/spark,big-pegasus/spark,rekhajoshm/spark,zhouyejoe/spark,esi-mineset/spark,narahari92/spark,joseph-torres/spark,janewangfb/spark,xflin/spark,JerryLead/spark,publicRoman/spark,debugger87/spark,BryanCutler/spark,markhamstra/spark,jiangxb1987/spark,HyukjinKwon/spark,highfei2011/spark,maropu/spark,zuotingbing/spark,jiangxb1987/spark,akopich/spark,eyalfa/spark,Panos-Bletsos/spark-cost-model-optimizer,narahari92/spark,lxsmnv/spark,poffuomo/spark,chuckchen/spark,bOOm-X/spark,nilsgrabbert/spark,aokolnychyi/spark,zzcclp/spark,joseph-torres/spark,BryanCutler/spark,ioana-delaney/spark,huang1900/spark,ibm-research-ireland/sparkoscope,cin/spark,apache/spark,hvanhovell/spark,adrian-ionescu/apache-spark,ron8hu/spark,rikima/spark,wangyum/spark,saturday-shi/spark,facaiy/spark,jrshust/spark,Aegeaner/spark,rikima/spark,JoshRosen/spark,kimoonkim/spark,ueshin/apache-spark,rezasafi/spark,brad-kaiser/spark,jlopezmalla/spark,mzl9039/spark,debugger87/spark,facaiy/spark,lxsmnv/spark,mdespriee/spark,loneknightpy/spark,apache/spark,wangmiao1981/spark,rednaxelafx/apache-spark,wzhfy/spark,WindCanDie/spark,icexelloss/spark,liyichao/spark,dbtsai/spark,yanboliang/spark,goldmedal/spark,xflin/spark,minixalpha/spark,michalsenkyr/spark,bOOm-X/spark,loneknightpy/spark,jianran/spark,shaneknapp/spark,holdenk/spark,kimoonkim/spark,nchammas/spark,techaddict/spark,zhouyejoe/spark,minixalpha/spark,dongjoon-hyun/spark,jkbradley/spark,hvanhovell/spark,1haodian/spark,kissmetrics/spark,ibm-research-ireland/sparkoscope,holdenk/spark,minixalpha/spark,dbtsai/spark,rekhajoshm/spark,ibm-research-ireland/sparkoscope,rekhajoshm/spark,tengpeng/spark,markhamstra/spark,szhem/spark,LantaoJin/spark,saltstar/spark,witgo/spark,highfei2011/spark,jkbradley/spark,1haodian/spark,guoxiaolongzte/spark,jrshust/spark,apache/spark,panfengfeng/spark,xuanyuanking/spark,poffuomo/spark,UndeadBaneGitHub/spark,ddna1021/spark,ajaysaini725/spark,1haodian/spark,JerryLead/spark,mzl9039/spark,stanzhai/spark,kissmetrics/spark,ericvandenbergfb/spark,ron8hu/spark,jlopezmalla/spark,poffuomo/spark,wzhfy/spark,darionyaphet/spark,shubhamchopra/spark,darionyaphet/spark,MLnick/spark,tejasapatil/spark,cin/spark,ueshin/apache-spark,aray/spark,hhbyyh/spark,esi-mineset/spark,hhbyyh/spark,big-pegasus/spark,sureshthalamati/spark,WeichenXu123/spark,aokolnychyi/spark,ptkool/spark,akopich/spark,ericvandenbergfb/spark,holdenk/spark,bravo-zhang/spark,wangyum/spark,mzl9039/spark,icexelloss/spark,big-pegasus/spark,hvanhovell/spark,publicRoman/spark,milliman/spark,michalsenkyr/spark,liutang123/spark,HyukjinKwon/spark,ptkool/spark,milliman/spark,nlalevee/spark,ueshin/apache-spark,BryanCutler/spark,liutang123/spark,srowen/spark,someorz/spark,wzhfy/spark,apache-spark-on-k8s/spark,srowen/spark,someorz/spark,aray/spark,nilsgrabbert/spark,ericvandenbergfb/spark,tejasapatil/spark,big-pegasus/spark,UndeadBaneGitHub/spark,sachintyagi22/spark,JerryLead/spark,Panos-Bletsos/spark-cost-model-optimizer,ioana-delaney/spark,Panos-Bletsos/spark-cost-model-optimizer,actuaryzhang/spark,apache-spark-on-k8s/spark,mdespriee/spark,Panos-Bletsos/spark-cost-model-optimizer,akopich/spark,markhamstra/spark,patrick-nicholson/spark,zzcclp/spark,lxsmnv/spark,witgo/spark,zero323/spark,bOOm-X/spark,huang1900/spark,rikima/spark,taroplus/spark,alunarbeach/spark,apache-spark-on-k8s/spark,szhem/spark,patrick-nicholson/spark,milliman/spark,eyalfa/spark,zzcclp/spark,mike0sv/spark,nlalevee/spark,sachintyagi22/spark,lvdongr/spark,jlopezmalla/spark,ajaysaini725/spark,witgo/spark,poffuomo/spark,loneknightpy/spark,Aegeaner/spark,rikima/spark,zuotingbing/spark,yanboliang/spark,huang1900/spark,panfengfeng/spark,aray/spark,BryanCutler/spark,nilsgrabbert/spark,joseph-torres/spark,SHASHANKB/spark,xuanyuanking/spark,nilsgrabbert/spark,rezasafi/spark,caneGuy/spark,chuckchen/spark,highfei2011/spark,alunarbeach/spark,ueshin/apache-spark,SHASHANKB/spark,actuaryzhang/spark,ptkool/spark,icexelloss/spark,aokolnychyi/spark,jiangxb1987/spark,saltstar/spark,taroplus/spark,Panos-Bletsos/spark-cost-model-optimizer,mike0sv/spark,rikima/spark,WeichenXu123/spark,szhem/spark,hhbyyh/spark,big-pegasus/spark,skonto/spark,stanzhai/spark,spark-test/spark,brad-kaiser/spark,saltstar/spark,ptkool/spark,nlalevee/spark,ddna1021/spark,rednaxelafx/apache-spark,aokolnychyi/spark,wangyum/spark,liyichao/spark,aray/spark,setjet/spark,chuckchen/spark,ahnqirage/spark,WindCanDie/spark,byakuinss/spark,jlopezmalla/spark,pgandhi999/spark,ahnqirage/spark,jiangxb1987/spark,skonto/spark,joseph-torres/spark,patrick-nicholson/spark,gengliangwang/spark,someorz/spark,markhamstra/spark,srowen/spark,ron8hu/spark,saturday-shi/spark,shaneknapp/spark,metamx/spark,JerryLead/spark,SnappyDataInc/spark,someorz/spark,shuangshuangwang/spark,spark-test/spark,patrick-nicholson/spark,wangyum/spark,ueshin/apache-spark,milliman/spark,zero323/spark,wangyum/spark,tejasapatil/spark,cin/spark,map222/spark,taroplus/spark,jiangxb1987/spark,lxsmnv/spark,MLnick/spark,zero323/spark,mdespriee/spark,adrian-ionescu/apache-spark,apache-spark-on-k8s/spark,hhbyyh/spark,saturday-shi/spark,spark-test/spark,aosagie/spark,dhruve/spark,kimoonkim/spark,zzcclp/spark,patrick-nicholson/spark,JoshRosen/spark,jlopezmalla/spark,maropu/spark,apache/spark,debugger87/spark,gengliangwang/spark,LantaoJin/spark,hvanhovell/spark,loneknightpy/spark,dbtsai/spark,vinodkc/spark,facaiy/spark,SnappyDataInc/spark,eyalfa/spark,shuangshuangwang/spark,goldmedal/spark,map222/spark,ajaysaini725/spark,zuotingbing/spark,jkbradley/spark,shuangshuangwang/spark,yanboliang/spark,rezasafi/spark,kissmetrics/spark,janewangfb/spark,hvanhovell/spark,dongjoon-hyun/spark,nchammas/spark,1haodian/spark,taroplus/spark,huang1900/spark,zhouyejoe/spark,vinodkc/spark,joseph-torres/spark,narahari92/spark,aray/spark,adrian-ionescu/apache-spark,wangmiao1981/spark,metamx/spark,goldmedal/spark,michalsenkyr/spark,debugger87/spark,dongjoon-hyun/spark,szhem/spark,brad-kaiser/spark,narahari92/spark,wangmiao1981/spark,cloud-fan/spark,cin/spark,lvdongr/spark,LantaoJin/spark,nilsgrabbert/spark,mzl9039/spark,techaddict/spark,liyichao/spark,pgandhi999/spark,alunarbeach/spark,shaneknapp/spark,tengpeng/spark,zzcclp/spark,andrewor14/spark,aosagie/spark,actuaryzhang/spark,byakuinss/spark,aokolnychyi/spark,shubhamchopra/spark,dhruve/spark,goldmedal/spark,cloud-fan/spark,ron8hu/spark,tejasapatil/spark,esi-mineset/spark,Aegeaner/spark,aosagie/spark,someorz/spark,rekhajoshm/spark,Panos-Bletsos/spark-cost-model-optimizer,dhruve/spark,mdespriee/spark,ericvandenbergfb/spark,nilsgrabbert/spark,nilsgrabbert/spark,holdenk/spark,adrian-ionescu/apache-spark,bOOm-X/spark,ibm-research-ireland/sparkoscope,shubhamchopra/spark,jkbradley/spark,rednaxelafx/apache-spark,jiangxb1987/spark,SHASHANKB/spark,SHASHANKB/spark,1haodian/spark,tengpeng/spark,goldmedal/spark,icexelloss/spark,adrian-ionescu/apache-spark,gengliangwang/spark,caneGuy/spark,holdenk/spark,skonto/spark,zero323/spark,poffuomo/spark,skonto/spark,michalsenkyr/spark,panfengfeng/spark,srowen/spark,UndeadBaneGitHub/spark,ddna1021/spark,kiszk/spark,kiszk/spark,HyukjinKwon/spark,dongjoon-hyun/spark,zuotingbing/spark,ahnqirage/spark,ioana-delaney/spark,wangyum/spark,ahnqirage/spark,markhamstra/spark,loneknightpy/spark,sachintyagi22/spark,byakuinss/spark,mzl9039/spark,brad-kaiser/spark,guoxiaolongzte/spark,rekhajoshm/spark,rekhajoshm/spark,cin/spark,andrewor14/spark,tejasapatil/spark,aray/spark,apache-spark-on-k8s/spark,ajaysaini725/spark,hhbyyh/spark,mike0sv/spark,saturday-shi/spark,wangmiao1981/spark,jrshust/spark,mahak/spark,caneGuy/spark,pgandhi999/spark,JoshRosen/spark,nchammas/spark,szhem/spark,ibm-research-ireland/sparkoscope,sureshthalamati/spark,guoxiaolongzte/spark,dbtsai/spark,shaneknapp/spark,setjet/spark,MLnick/spark,dhruve/spark,nchammas/spark,1haodian/spark,cloud-fan/spark,setjet/spark,gengliangwang/spark,milliman/spark,kevinyu98/spark,yanboliang/spark,BryanCutler/spark,ConeyLiu/spark,byakuinss/spark,lvdongr/spark,witgo/spark,pgandhi999/spark,vinodkc/spark,dbtsai/spark,sureshthalamati/spark,facaiy/spark,someorz/spark,jianran/spark,guoxiaolongzte/spark,liutang123/spark,andrewor14/spark,esi-mineset/spark,maropu/spark,nchammas/spark,stanzhai/spark,ajaysaini725/spark,sureshthalamati/spark,andrewor14/spark,sahilTakiar/spark,kissmetrics/spark,sachintyagi22/spark,highfei2011/spark,debugger87/spark,saltstar/spark,zero323/spark,cloud-fan/spark,loneknightpy/spark,mahak/spark,ptkool/spark,WeichenXu123/spark,alunarbeach/spark,saturday-shi/spark,gengliangwang/spark,srowen/spark,markhamstra/spark,janewangfb/spark,apache/spark,liutang123/spark,MLnick/spark,witgo/spark,sureshthalamati/spark,kiszk/spark,stanzhai/spark,goldmedal/spark,tejasapatil/spark,bOOm-X/spark,HyukjinKwon/spark,wzhfy/spark,highfei2011/spark,apache/spark,map222/spark,akopich/spark,lvdongr/spark,debugger87/spark,spark-test/spark,vinodkc/spark,sahilTakiar/spark,shuangshuangwang/spark,actuaryzhang/spark,mahak/spark,saturday-shi/spark,publicRoman/spark,JerryLead/spark,rednaxelafx/apache-spark,1haodian/spark,Aegeaner/spark,sahilTakiar/spark,kiszk/spark,aokolnychyi/spark,skonto/spark,shubhamchopra/spark,maropu/spark,witgo/spark,caneGuy/spark,dongjoon-hyun/spark,ioana-delaney/spark,rezasafi/spark,pgandhi999/spark,liyichao/spark,liutang123/spark,cloud-fan/spark,cloud-fan/spark,sahilTakiar/spark,xuanyuanking/spark,ibm-research-ireland/sparkoscope,poffuomo/spark,guoxiaolongzte/spark,ioana-delaney/spark,yanboliang/spark,shubhamchopra/spark,ConeyLiu/spark,icexelloss/spark,aosagie/spark,rikima/spark,rekhajoshm/spark,narahari92/spark,kevinyu98/spark,dbtsai/spark,tengpeng/spark,dhruve/spark,ConeyLiu/spark,rikima/spark,apache-spark-on-k8s/spark,mzl9039/spark,liutang123/spark,Aegeaner/spark,jianran/spark,tengpeng/spark,bdrillard/spark,WindCanDie/spark,esi-mineset/spark,shubhamchopra/spark,ueshin/apache-spark,liyichao/spark,lxsmnv/spark,xflin/spark,metamx/spark,mike0sv/spark,facaiy/spark,spark-test/spark,ddna1021/spark,wangmiao1981/spark,chuckchen/spark,setjet/spark,darionyaphet/spark,narahari92/spark,stanzhai/spark,panfengfeng/spark,rezasafi/spark,xflin/spark,zuotingbing/spark,tengpeng/spark,aosagie/spark,byakuinss/spark,srowen/spark,big-pegasus/spark,big-pegasus/spark,tengpeng/spark,ahnqirage/spark,hvanhovell/spark,apache-spark-on-k8s/spark,metamx/spark,wzhfy/spark,kimoonkim/spark,actuaryzhang/spark,kevinyu98/spark,jrshust/spark,ddna1021/spark,jianran/spark,UndeadBaneGitHub/spark,pgandhi999/spark,liutang123/spark,dongjoon-hyun/spark,setjet/spark,setjet/spark,brad-kaiser/spark,aosagie/spark,shubhamchopra/spark,ron8hu/spark,aokolnychyi/spark,srowen/spark,actuaryzhang/spark,highfei2011/spark,milliman/spark,SnappyDataInc/spark,Panos-Bletsos/spark-cost-model-optimizer,xflin/spark,lxsmnv/spark,SHASHANKB/spark,janewangfb/spark,joseph-torres/spark,zero323/spark,SnappyDataInc/spark,lvdongr/spark,lvdongr/spark,ioana-delaney/spark,dhruve/spark,kimoonkim/spark,sahilTakiar/spark,panfengfeng/spark,kiszk/spark,WeichenXu123/spark,SHASHANKB/spark,MLnick/spark,jkbradley/spark,ahnqirage/spark,saltstar/spark,zero323/spark,hvanhovell/spark,poffuomo/spark,zhouyejoe/spark,saturday-shi/spark,hhbyyh/spark,cloud-fan/spark,vinodkc/spark,ddna1021/spark,bOOm-X/spark,kissmetrics/spark,janewangfb/spark,michalsenkyr/spark,michalsenkyr/spark,eyalfa/spark,jkbradley/spark,nlalevee/spark,wzhfy/spark,xuanyuanking/spark,LantaoJin/spark,actuaryzhang/spark,UndeadBaneGitHub/spark,SHASHANKB/spark,szhem/spark,ericvandenbergfb/spark,janewangfb/spark,alunarbeach/spark,cin/spark,goldmedal/spark,maropu/spark,eyalfa/spark,techaddict/spark,publicRoman/spark,ron8hu/spark,mdespriee/spark,ajaysaini725/spark,maropu/spark,huang1900/spark,ConeyLiu/spark,loneknightpy/spark,chuckchen/spark,bravo-zhang/spark,nchammas/spark,metamx/spark,jrshust/spark,guoxiaolongzte/spark,yanboliang/spark,caneGuy/spark,ericvandenbergfb/spark,aray/spark,darionyaphet/spark,apache/spark,nchammas/spark,michalsenkyr/spark,markhamstra/spark,ddna1021/spark,mahak/spark,ptkool/spark,debugger87/spark,tejasapatil/spark