Gracefully handle EAGAIN in readline (#406)