Ignition and extinction of flames near surfaces: Combustion of H2 in air