Jamal Musiala came off the bench to help steer Bayern Munich past a resilient Heidenheim side on Matchday 13.