Restrict terminal size to 255x255 max to avoid uint8 overflow.

grub's terminal subsystem encodes x/y coordinates in a uint16.
When running grub-emu, it's not difficult to set up a terminal
with a size larger than this. The curses library routine will
return an int for the maximum x/y offsets for the window,
and dropping these into an int16 confuses grub.

Fix by clamping the returned size to 255 for x/y.