Electronic properties of hydrogen and oxygen terminated surfaces of polycrystalline diamond films