Rename deprecated EnumSet methods in unit tests.
Make os::getcwd() return Option<Path>

os::getcwd() panics if the current directory is not available. According
to getcwd(3), there are three cases:

- EACCES: Permission denied.
- ENOENT: The current working directory has been removed.
- ERANGE: The buffer size is less than the actual absolute path.

This commit makes os::getcwd() return Option<Path>, not just Path. This
also prevents panics.