Holes trapped near Mg2+ and Al3+ impurities in SrTiO3