Structure and electronic states of ultrathin SiO2 thermally grown on Si(100) and Si(111) surfaces