If getcwd fails, do not treat this as an error, but print a warning and unset PWD. This is similar to the behaviour when starting the shell in a directory whose name cannot be determined.