Avoid calling X11 functions from the TTY thread

X11 can block for as long as it wants, so it's better to send X11
commands in a spearate thread.

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