term.c: Don't call exit() from input thread

Let the process exit through main instead.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Treat EnterNotify and LeaveNotify as focus events

This is most useful when there is no window manager running.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>