Reorganize helper functions into anonymous namespace.

Even if your compiler doesn't support the C++ ABI demangling stuff or
GLIBC backtrace(), we can try to get a gdb backtrace.