Handle OutOfMemory when opening and reading file.
Pass OutOfMemory exception to top exception handler before doing an abort
so that the SystemExit exception that is raised by abort is not caught by
higher handlers.
adjust shutdown behavior