GrafX2: fixed crash in getcwd()