Add a trivial CSafeSyscall template that calls a callback until it stops returning EINTR, and use it everywhere we use select() now. Thanks to Andreas for the suggestion of using a template parameter for the syscall function to invoke.