[SPARK-3854] Scala style: require spaces before `{`

This PR is a solution proposal of SPARK-3854.

Following is quoted from SPARK-3854:

We should require spaces before opening curly braces. This isn't in the style guide, but it probably should be:

    // Correct:
    if (true) {
      println("Wow!")
    }

    // Incorrect:
    if (true){
       println("Wow!")
    }

See https://github.com/apache/spark/pull/1658#discussion-diff-18611791 for an example "in the wild."
git grep "){" shows only a few occurrences of this style.