[SPARK-2627] follow Spark bash style for if blocks

“then” goes on the same line as the opening “if”.