Fix off-by-one issue of CPR on the right edge of terminal

resize(1) command (distributed with xterm) sometimes move cursor to (999, 999) and get CPR response for retrieve current dimensions of terminal text area.
On xterm, this command behaves as follows:

```
% resize -s 24 80
COLUMNS=80;
LINES=24;
export COLUMNS LINES;

% resize
COLUMNS=80;
LINES=24;
export COLUMNS LINES;
```

But on current iTerm2, this shows as follows:

```
% resize -s 24 80
COLUMNS=80;
LINES=24;
export COLUMNS LINES;

% resize
COLUMNS=81;
LINES=24;
export COLUMNS LINES;
```

For one more example:

```
% printf "\033[8;24;80t\033[999;999H\033[6n";cat
```

The report for above sequence in iTerm2 is

```
^[[24;81R
```

but it should be:

```
^[[24;80R
```

This patch will fix above problem.