Hmmm... Just 'imported' the SDL_main code from the PSP 1.2.15 branch diff into UniPCemu's SDL_main, then removed the SDLmain library and define from the LIBS and CFLAGS. So in that way, UniPCemu uses a copy of said code to initialize SDLmain on the PSP.
So now when testing it again, the main thread actually seems to call the sceKernelExitGame function instead of SDL's update_thread.
Now I still need to check if it's actually the main cleanup doing the termination.
So far it just looks like SDL's default update_thread in it's SDLmain library was interfering with UniPCemu's replacement handler (which lets the main thread handle termination properly instead of (what PSP SDL does) directly calling the exit() function to terminate the app).
And since the atexit also registers various structures UniPCemu allocates itself(it's custom memory management handling, cleanup of structures), perhaps it was conflicting with what the main function was also doing at the same time (those final steps)? Probably the threading having memory conflicts?
Edit: Just temporarily for debugging enabled the logging and behold: the application now properly handles it's termination past the last few steps with the SDLmain custom implementation for the PSP builds! :D
Edit: Just tried it on my physical PSP-2000. It seems to run without issues now, including quitting the app! :D
These fixes will definitely be in the next release, once it's ready!