The Grothendieck-Katz Conjecture for certain locally symmetric varieties