Quantitative analysis of weak localization in thin Mg films by magnetoresistance measurements