[SPARK-19231][SPARKR] add error handling for download and untar for Spark release
[SPARK-19231][SPARKR] add error handling for download and untar for Spark release

## What changes were proposed in this pull request?

When R is starting as a package and it needs to download the Spark release distribution we need to handle error for download and untar, and clean up, otherwise it will get stuck.

## How was this patch tested?

manually

Author: Felix Cheung <felixcheung_m@hotmail.com>

Closes #16589 from felixcheung/rtarreturncode.

(cherry picked from commit 278fa1eb305220a85c816c948932d6af8fa619aa)
Signed-off-by: Felix Cheung <810d837eab49a32915fef3ad1ae15af3fe7891e7@apache.org>

big-pegasus/spark,SnappyDataInc/spark,SnappyDataInc/spark,SnappyDataInc/spark,big-pegasus/spark,SnappyDataInc/spark,SnappyDataInc/spark,SnappyDataInc/spark,big-pegasus/spark,big-pegasus/spark,SnappyDataInc/spark,big-pegasus/spark,big-pegasus/spark,big-pegasus/spark