Fast ion confinement in the three-dimensional helical reversed-field pinch