Don't write to /tmp/refs when REF_DEBUG is not defined.

If MALLOC_DEBUG is enabled, then the debug destructor for the container
is used, which would erroneously write to /tmp/refs. This patch only
uses the debug destructor if ref_debug is used.

(closes issue ASTERISK-22536)
........

Merged revisions 399098 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 399099 from http://svn.asterisk.org/svn/asterisk/branches/11
........

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


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