fix segfault when getting gvim's cwd