Move validation on events out of the input device

Also, rearchitect how we read from stdin and evdev simultaneously. This way we never throw away
valid key events and everything is a little bit cleaner.
gofmt code