top.py - register curses.endwin when program exit.