Fix #19

Fixes problem in get_cursor_vertical_diff where calling being interrupted by a signal handler that called it again causes a crash. The crash is observable by running examples/demo_scrolling.py in Python 3 and changing the window size quickly without using tmux.

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), and can I use an unbuffered version?
* 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 endowed this function with? (something like "reentrant")
* 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?