res_ari: Fix various memory leaks.

This change fixes a few memory leaks that were found based
on a mailing list post.

1. Some JSON response messages were never freed. This was
caused by the documentation stating that message references
were stolen when in reality they were not. The code now follows
the documentation and usage has been updated.

2. HTTP response headers were never freed.

3. The variable list for wildcards paths was never freed.

(closes issue ASTERISK-23128)
Reported by: Kenneth Watson (on list)

Review: https://reviewboard.asterisk.org/r/3119/


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