Changes in the work function of titanium films owing to the chemisorption of N2, O2, CO and CO2