This lays some groundwork for landing threaded input by tidying up the use of SIGIO within the server. It's still not complete, as it still does not add mutexes around the input state, but at least the first four patches should stand on their own. - ajax