SQL Memory allocation tracing and overflow detection

1) Added code to record stack info when given size of memory blocks are
allocated and dump these info out to a file or terminal if the
deallocation is not made at the time the heap is distructed. This works
for heaps constructed from NAMemory.
2) Fixed the memory debug code to detected memory overflow at the
de-allocation time.
These two features are enabled through environment variables in objects
compiled in debug mode. See sql/common/NAMemory.cpp for details.
3) Fixes for memory usage issues found when testing above code.

Change-Id: Id0e180aee3d069de11836904e80a4290b180dc67
Merge "SQL Memory allocation tracing and overflow detection"