Fix OOM cleanup in huge_palloc().

Fix OOM cleanup in huge_palloc() to call idalloct() rather than
base_node_dalloc().  This bug is a result of incomplete refactoring, and
has no impact other than leaking memory during OOM.
Style fixes.
Add a C11 atomics-based implementation of atomic.h API.
Style and spelling fixes.