fix Pkg usage of cwd() and add deprecation of cwd() for pwd().

Closes #2007.