Thermodynamic and kinetic aspects of decomposition of MgB2 in vacuum: Implications for optimization of synthesis conditions