Lock free stack implementation

Needed for free lists of various types. Also moved all magic types to lw_magic.h file.