Fixed issue in connection pool where close would happen to late for the pool to stop connecting