use Cwd::getcwd() instead of Cwd::cwd()

getcwd() is more efficient than cwd(), because it does not use the
external command pwd.