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().


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

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

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