Two-loop QCD corrections to the MSSM Higgs masses beyond the effective-potential approximation