only close rl on ctrl-d when line is empty

like https://github.com/joyent/node/blob/master/lib/readline.js#L669