Resummed mass distribution for jets initiated by massive quarks