Fix up sys*stat

I'd rather not go into how big a mess I made of these
functions. It's all better now.

Signed-off-by: Ronald G. Minnich <rminnich@google.com>