tests: create a helper to check TypeKind

The helper will throw an exception on unexposed types. This allows
the test runner to produce a skipped or failed message depending
on the libclang version.