Fix 19

Fixes problem in get_cursor_vertical_diff where calling being interrupted by a signal handler that called it again causes a crash.

Questions:

* Why was the bug only in Python 3? (what's special about [these buffered io objects](https://docs.python.org/2/library/io.html#reentrancy)?
* What's the normal behavior of a re-entrant read on a file? Is that a question that makes sense? 
* What is the name for the property I have given 
* It seems like locks don't work here - are there similar tools I could have used instead of this?
* Is this the best way to do this?