Fix termchar handling

Termination character is erroneously converted to a string, which
struct.pack cannot handle. This should be passed in as an integer.
fix similar problem with term_char
Merge pull request #4 from philpem/philpem_fix_termchar_handling

Fix termchar handling