Measurement of J/psi helicity distributions in inelastic photoproduction at HERA