Invoke the error function on async connect/send failures