Fix race where ECONNREFUSED happens on connect