Lint stack code.
Lint and fix compilation of core buffer.
Add lock to per-core operations.
Remove per-core lock from allocator as it is handled a level above.