Fix SDL-related build breakages when not building the client.
Properly fix server and tty client usage of SDL.
TTY client needs pthread.
SDL 1.2: fix input of non-ASCII.
SDL 1.2: fix deletion and Ctrl+key in the in-game console.