add __cxa_atexit hook and cleanup TRACEs

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>