Fix a regression where, on some platforms, errors from async_connect are not correctly propagated through to the completion handler.