Quark mass renormalization in the MS and RI schemes up to the NNLO order