Workaround ruby 1.8 IO#getc returning integer types

Also make test more likely to halt when failing.