igo: split main into main+run to run the atexit function