dir: avoid incidentally removing the original_cwd in remove_path()