Retry tcsetattr on EINTR and report failure

As discussed, this checks for `EINTR` on `tcsetattr`. I did not use the glibc macro, as that makes it harder for me to port rather than easier.