Effects of Barrier Height Inhomogeneity on Core Level Photoemission from Clean and Metal-Covered Semiconductor Surfaces