Prevent heap alloc functions from running out of stack space.

When asterisk has run out of memory (for whatever reason), the alloc
function logs a message. Logging requires memory. A recipe for
infinite recursion.

Stop the recursion by comparing the function call depth for sane values
before attempting another OOM log message.

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


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