Spin-dynamics simulations of the three-dimensional XY model: Structure factor and transport properties