channel_internal_api.c: Replace some code with ao2_replace().

Use ao2_replace() instead of ao2_cleanup(); ao2_bump().

ao2_replace() has the advantange of not altering the ref count if the
replaced pointer is the same.

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

Merged revisions 420992 from http://svn.asterisk.org/svn/asterisk/branches/13


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