Exit cleanly (do not terminate thread)