Fix caching topic shutdown assertions

The recent changes to update stasis_cache_topics directly from the
publisher thread uncovered a race condition, which was causing asserts
in the /stasis/core tests.

If the caching topic's subscription is the last reference to the
caching topic, it will destroy the caching topic after the final
message has been processed. When dispatching to a different thread,
this usually gave the unsubscribe enough time to finish before
destruction happened. Now, however, it consistently destroys before
unsubscription is complete.

This patch adds an extra reference to the caching topic, to hold it
for the duration of the unsubscription.

This patch also removes an extra unref that was happening when the
final message was received by the caching topic. It was put there
because of an extra ref that was put into the caching topic's
constructor. Both have been removed, which makes the destructor a bit
less confusing.

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


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