Make pexpect.py Python 3 Compatable

Warning changes have been not tested against Python 2!
If the code works in Python2 then this patch resolves Buildozer Issue #131.
https://github.com/kivy/buildozer/issues/131