Oxygen depletion shutdown algorithm for portable gasoline generators