Fix resize handling

Patch from Egmont Koblinger.  At least it's readable...

Bug 707572 - Aborts on assertion (debug mode)
Bug 708213 - zsh - lots of blank space upon resizing VTE based terminals