In a channel destructor dispose of items that raise Stasis message properly

This patch reorders certain actions that may raise Stasis messages in the
channel destructor such that they occur before the Stasis cache is cleared.
Once the Stasis cache is cleared, its rather a bad idea to be trying to
publish information about a channel.

(closes issue ASTERISK-22001)
Reported by: Jonathan Rose



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