stasis.c: Misc code cleanups.

* Remove some unnecessary RAII_VAR() usage.

* Made the struct stasis_subscription ao2 object use the ao2 lock instead
of a redundant join_lock in the struct for ast_cond_wait().

* Removed locks on some ao2 objects that don't need the lock.

* Made the topic pool entries container use the ao2 template functions.

* Add some missing allocation failure checks.

* Add missing cleanup in off nominal path of dispatch_message().
........

Merged revisions 409270 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@409271 f38db490-d61c-443f-a65b-d21fe96a405b
stasis_cache.c: Remove some unnecessary RAII_VAR() usage.
........

Merged revisions 409272 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@409273 f38db490-d61c-443f-a65b-d21fe96a405b
devicestate.c: Simplified some logic in _ast_device_state().
........

Merged revisions 409274 from http://svn.asterisk.org/svn/asterisk/branches/12


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