Measurement of the gluon structure function from direct photon data at the CERN p-antip collider