MapFile: fix NPE at close file