Component-by-component construction of randomized rank-1 lattice rules achieving almost the optimal randomized error rate