Add basic support for nonblocking read