Heavy quark masses in the continuum limit of Lattice QCD