Electronic structure of benzene on Ni(100) and Cu(110): An x-ray-spectroscopy study