[PATCH 4.9 274/310] random: use lockless method of accessing and updating f->reg_idx