Gracefully handle imperfect unit state data.

When inspecting units for errors, we need to be able to deal with malformed or missing data returned from the API. We already know an error condition exists, so there's no guarantee things will be as they should. Inspect as many fields as possible to determine if there's a relation error. Don't assume a field is actually present; if it isn't, move on.
Hmm, I guess this function is 'endpointHasError' so it's an assumption that the relation showing in agentStateInfo is in fact an error and not something like general info?