astobj2: work around REF_DEBUG race which causes out of order log entries

* Update refcounter.py to use delta's to track the current reference count.
* Use result from internal_ao2_ref to write old_refcount to refs_log.

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


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