SPARK-2869 - Potential leak of Jdbc Connection and PreparedStatement in case of error in JdbcRDD 

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. 
Actually as I look at this again, I think the try is not necessary. Basically the first line in the constructor adds "closeIfNeeded" callback to the complete callback list. Then if any exception is thrown, even during the constructor, I think closeIfNeeded is called to close connections.