Ab initio theory of magnetic-field-induced odd-frequency two-band superconductivity in MgB 2