Catch OSError as well as select.error for interrupted syscall.