Spin quenching of transition metals deposited on MgO insulator and CdO semiconductor density functional calculations