Fixed a data race in the TestConnection() test