Probing the Cosmic Metallicity Evolution with Gamma-Ray Bursts