Handle errno == EINTR from poll

Signed-off-by: Morten Hustveit <mortehu@google.com>
Ignore XNextEvent return value

XNextEvent is declared to return int, but actually returns void.  See the "Xlib
Programming Manual" by Adrian Nye.

Signed-off-by: Morten Hustveit <mortehu@google.com>
Exit write loop after write fails

Signed-off-by: Morten Hustveit <mortehu@google.com>
Check return value of chdir

chdir to $HOME may fail in some cases

Signed-off-by: Morten Hustveit <mortehu@google.com>
Add libglew-dev to install-debian-deps.sh

Signed-off-by: Morten Hustveit <mortehu@google.com>