libclang: use CXCursor getters to simplify code