Catch ValueError that (sometimes?) occurs when pressing a special key
Do not assume that target streams can be flushed.
- This allows standard output to be rerouted to objects without a `flush()` method.
Merge pull request #349 from smathot/master

Do not except on special keys (such as 'volume up') and do not assume `.flush()` methods on standard output.