VIM-702 Fix infinite loop on s/$/\r/g

If the replacement contains newlines, the line number of the current
search position needs to be adjusted. Without this, e.g. s/$/\r/g would
get into an infinite loop.