Fix another copy-paste mistake in calculateScrollPos

Issue #2819
Limit loop in scrollPosIntoView at 5 steps

To prevent infinite loops when the algorithm somehow doesn't converge

(It should converge, but infinite loops with nebulous termination
conditions are a rather bad source of hangs.)

I'm still torn about this, since it'll mask bugs.

Issue #2819