main_nogui: clean up before exiting
main_nogui: convert to God's own line-endings

(i.e. Unix style)
main_nogui: make sure to include cstdlib for EXIT_SUCCESS