Does anyone know if it is a known method that can be attributed to some paper?
Dunno. I remember doing this circa 25 years ago (and I didn't read it anywhere); it's quite likely that multiple people made the same observation independently.
In the code, there is a limit on the maximum increment, after which a new prime is sampled and residues recalculated.
I can think of two reasons:
They just don't trust the math that says that $ai+b$ will always eventually be prime for some $i$ (as long as $a, b$ are relatively prime); or
They're worried about potential bugs which might cause an infinite loop (e.g. if $a, b$ aren't relatively prime, this will infinite loop - impossible ifalthough, because they use $a=2$ and $b$ is selected odd; conceivable ifassuming they use some other strategy to selectalways pick the starting point $a, b$$b$ odd, this cannot happen)