Measurement of residual stress in MgO thin films on GaAs by electron microscopy