Creates a new attribute with the name name, if name is NULL, then the attribute will be nameless. Returns the allocated attribute upon success or NULL upon failure.