Fix #54 - missing close/free in sys_chdir