Fix scroll jitter when deleting a line reduces the maximum allowed scrollTop

Fixes #2725