Compare against constant when checking error code of producer error tests

The connection refused error on OSX is 61 not 111. Comparing error code against the constant to make the test OS neutral.