Don't shadow a variable.

The previous state was harmless in practice, but lead to warnings.
Just abort on collation errors when in a sandbox.

I don't understand why write is used here when other functions in this file
use printf.  I don't think printing simple formats requirest collation.
Be more agressive at avoiding syscalls with FORCE_C_LOCALE.
Add a time(3) implementation.
Supress some syscalls by forcing the use of UTC.
Fault in more functions.
Add an exit implementation (implemented as abort()).
Avoid a getenv() call by supressing some Y2K warnings.