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


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