lib/process: Add helper for check process clean exit