Adjust DisplayBuffer::longestScreenRow when lines are inserted/removed

Fixes #2810

The line corresponding to the longest screen row moves when lines are
inserted or removed above it, so we need to adjust it accordingly or we
won't always realize when a change affects the longest line.