os: Depends on stat.
os: Don't use legacy getwd() libc function, not available in all libc's.

For example, not available in uclibc.