Gluon polarization tensor and dispersion relation in a weakly magnetized medium