Measurement of charm and beauty production in deep inelastic ep scattering from decays into muons at HERA