Portable current-working-directory changing