more exit/_exit cleanups, add atexit if available, see #136