SPARK-2869 - Fix tiny bug in JdbcRdd for closing jdbc connection

I inquired on  dev mailing list about the motivation for checking the jdbc statement instead of the connection in the close() logic of JdbcRDD. Ted Yu believes there essentially is none-  it is a simple cut and paste issue. So here is the tiny fix to patch it. 
while you are at it, do you mind adding curly braces for the close()? The spark coding style requires curly braces even for one-liner ifs. It's an oversight that we didn't do this for the ifs in this file.