Moved whole exit-handling of console window here (from pythonrun.c)
preferences file if it is missing.