Use atexit in main instead of goto

Makes more sense since there's no malloc/fopen in there