Exxon slashes spending after smallest profit in years