replaced deprecated Curses.endwin with Curses.close_screen

`Curses.endwin` is no longer in the `Curses` module, and has been replaced by [`close_screen`](http://www.ruby-doc.org/stdlib-2.0/libdoc/curses/rdoc/Curses.html#method-c-close_screen).