Always use getwd if HAVE_GETWD is defined.