Stability of rocksalt polar surfaces: An ab initio study of MgO(111) and NiO(111)