GambitREPL app: fix possible infinite recursion when creating directory recursively