Fix getch test sample for Python 3