[SPARK-2817] use system temporary folder instead of temporary files in the source tree, and also clean some empty line