[libc] Fix exit()
[libc] Fix exit()

The functions registered at atexit() must be called in reverse
order. This patch also protect against calling exit() from
some of the atexit handler.

k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc