Implement simple stack allocator.
Add support for multi-threaded access to stack allocator.