[SPARK-3106] Fix the race condition issue about Connection and ConnectionManager

Ah, double "connection != null" is redundant as you mentioned.