Check for valid coords before getting word at coords
Check for valid coords before getting word at coords

Fixes #1287

Tyriar/xterm.js,akalipetis/xterm.js,akalipetis/xterm.js,Tyriar/xterm.js,akalipetis/xterm.js,Tyriar/xterm.js,xtermjs/xterm.js,Tyriar/xterm.js,sourcelair/xterm.js,sourcelair/xterm.js,sourcelair/xterm.js,xtermjs/xterm.js,Tyriar/xterm.js,xtermjs/xterm.js,akalipetis/xterm.js,xtermjs/xterm.js,sourcelair/xterm.js,xtermjs/xterm.js