use getcwd in taint-mode test to match use in module

The module is using getcwd(), but the test had been using cwd() which
can return different results, especially on case insensitive
filesystems.