Fixed exception on clearing a window (issue 988)

git-svn-id: http://tesseract-ocr.googlecode.com/svn/trunk@1028 d0cd1f9f-072b-0410-8dd7-cf729c803f20
Fixed issue 1075

git-svn-id: http://tesseract-ocr.googlecode.com/svn/trunk@1029 d0cd1f9f-072b-0410-8dd7-cf729c803f20