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

O.K. Connecton#close is just for mark as closed and failure during closing is not recovered right?
If it is, using AtomicBoolean is reasonable.