Refactor: libcib: Change how the xpath query in find_attr is built.
It's possible for this function to recieve NULL for both attr_id and
attr_name, so handle that. This results in some duplication of the
strings that make up the parts of the query, but I find it much easier
to read this way.