Replace rand() usage by av_lfg_get().