Merge pull request #1649 from azat/be/BSD-connect-failures Fix tests failures due to incorrect handling of ECONNREFUSED on BSD