Refactor code and fix a reference leak

Refactor some channel blob publishing code to use
ast_channel_publish_blob now that it is available and fix a JSON
reference leak that was occurring during varset publishing.


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@390317 f38db490-d61c-443f-a65b-d21fe96a405b