native: optionally exit() after last thread has ended

Used when compiled with NATIVE_AUTO_EXIT defined.