A density-functional study on the stability of anatase-type phases in the system Mg–Ta–O–N