don't chop off prefix when mapping path for chdir

My previous pull request introduced a bug. Path mapping in chdir was chopping off the prefix.