fix #1306
Merge pull request #5973 from JuliaLang/jn/eof

cleaner ^C handling in REPL