First measurement of the fraction of top-quark pair production through gluon-gluon fusion