Strip trailing slashes when setting working directory.