Structural basis for the reaction mechanism of UDP-glucose pyrophosphorylase