Core-hole effects on theoretical electron-energy-loss near-edge structure and near edge x-ray absorption fine structure of MgO