BaseTool/VfrCompile: Fix potential memory leak issue