Replace read_nonblocking with read_checking_eof
Remove code depending on expect()