Fix xmldoc memory leak

This fixes a single-attribute memory leak that was occurring when the
"required" attribute was not true.

(closes issue ASTERISK-22249)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
    xmldoc-free_attr_required.patch uploaded by Corey Farrell
........

Merged revisions 397064 from http://svn.asterisk.org/svn/asterisk/branches/1.8


git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/11@397067 f38db490-d61c-443f-a65b-d21fe96a405b