Band gap opening in strongly compressed diamond observed by x-ray energy loss spectroscopy