tests: check CursorKind before class hierarchy

The Cursor class hierarchy is designed to reflect the CursorKind
hierarchy. If the CursorKind is incorrect (e.g. an unexposed kind),
the hierarchy will be incorrect. By checking CursorKind first,
better contextual information is provided on potential errors.