Add a test for socket connection races