Molecular dynamics of NaCl (B1 and B2) and MgO (B1) melting; two-phase simulation